Chronophoto jeux d'intuition et de connaissances
Jeu en ligne dans lequel tu dois deviner l'année où les photos ont été prises.
J'adore les jeux comme celui-ci ! CHRONOPHOTO
PowerShell Admin Tool Enchanced
PowerShell Admin Tool Enchanced
U need a folder ACSA on c:\ with Psexec & VNC exe server & Viewer
Insatall :
- Quest ActiveRoles Management https://www.powershelladmin.com/wiki/Quest_ActiveRoles_Management_Shell_Download

if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit }
##########################
#### PC SEARCH FORM 2 ####
##########################
Function FormPCSearch{
# Import the Assemblies
[reflection.assembly]::loadwithpartialname("System.Windows.Forms") | Out-Null
[reflection.assembly]::loadwithpartialname("System.Drawing") | Out-Null
$InitialFormWindowState2 = New-Object System.Windows.Forms.FormWindowState
# -----------------------------------------------
function SelectItem
{
$PCString = '$list2.SelectedItems | foreach-object {$_.text} #| foreach-object {$_.dnsname}'
$PCname = invoke-expression $PCString
$txt1.text = $PCName
$form2.Close()
}
$OnLoadForm_StateCorrection2=
{
$form2.WindowState = $InitialFormWindowState2
}
$form2 = New-Object System.Windows.Forms.Form
$form2.Text = "Loading..."
$form2.Name = "form2"
$form2.DataBindings.DefaultDataSourceUpdateMode = 0
$form2.StartPosition = "CenterScreen"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 550
$System_Drawing_Size.Height = 300
$form2.ClientSize = $System_Drawing_Size
$Form2.KeyPreview = $True
$Form2.Add_KeyDown({if ($_.KeyCode -eq "Escape")
{$Form2.Close()}})
# Label PC Search #
$lblPC = New-Object System.Windows.Forms.Label
$lblPC.TabIndex = 8
$lblPC.TextAlign = 256
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 255
$System_Drawing_Size.Height = 15
$lblPC.Size = $System_Drawing_Size
$lblPC.Text = "Double-click a computer or hit enter to select it."
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 10
$System_Drawing_Point.Y = 10
$lblPC.Location = $System_Drawing_Point
$lblPC.DataBindings.DefaultDataSourceUpdateMode = 0
$lblPC.Name = "lblCompname"
$lblPC.Visible = $false
$form2.Controls.Add($lblPC)
# Listview PC Search #
$list2 = New-Object System.Windows.Forms.ListView
$list2.UseCompatibleStateImageBehavior = $False
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 655
$System_Drawing_Size.Height = 370
$list2.Size = $System_Drawing_Size
$list2.DataBindings.DefaultDataSourceUpdateMode = 0
$list2.Name = "list2"
$list2.TabIndex = 2
$list2.anchor = "right, top, bottom, left"
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 10
$System_Drawing_Point.Y = 40
$list2.View = [System.Windows.Forms.View]"Details"
$list2.FullRowSelect = $true
$list2.GridLines = $true
$columnnames = "Computer","User","IP","LastLogon PC AD"
$list2.Columns.Add("Computer", 125) | out-null
$list2.Columns.Add("User", 125) | out-null
$list2.Columns.Add("IP", 125) | out-null
$list2.Columns.Add("LastLogonAD PC", 125) | out-null
$list2.Location = $System_Drawing_Point
$list2.add_DoubleClick({SelectItem})
$list2.Add_KeyDown({if ($_.KeyCode -eq "Enter")
{SelectItem}})
$form2.Controls.Add($list2)
$progress2 = New-Object System.Windows.Forms.ProgressBar
$progress2.DataBindings.DefaultDataSourceUpdateMode = 0
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 255
$System_Drawing_Size.Height = 23
$progress2.Size = $System_Drawing_Size
$progress2.Step = 1
$progress2.TabIndex = 0
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 10 #120
$System_Drawing_Point.Y = 10 #13
$progress2.Location = $System_Drawing_Point
$progress2.Name = "p1"
$progress2.text = "Loading..."
$form2.Controls.Add($progress2)
################################
####POPULATE PC SEARCH LIST ####
################################
function updatepclist
{
$PCs = get-qadcomputer $computername | sort-object -property name
$progress2.value = 20
if ($PCs.count){$progress2.step = (80/$PCs.count-1)}
else{$progress2.step = 80}
foreach($PC in $PCs){
$progress2.value += $progress2.step
$pingPCname = $PC.Name
$item2 = new-object System.Windows.Forms.ListViewItem($PC.name)
if (test-connection $pingPCname -quiet -count 1){
$PCuser = gwmi win32_computersystem -computername $PC.name -ev pcsearcherror
if ($pcsearcherror){$item2.subitems.add("Unavailable")} #PC can be pinged, but is not accessible
if ($PCuser.username -ne $null){$item2.subitems.add($PCuser.Username)} #PC pinged successfully and user is logged in
$IPC = (Get-ADComputer $PC.Name -Properties *).IPv4Address
$item2.subitems.add($IPC)
$LastLog = ((Get-ADComputer $PC.Name -Properties *).LastLogonDate).ToString()
$item2.subitems.add($LastLog)
} #End test-connection
else{$item2.subitems.add("Offline")} # PC cannot be pinged
$item2.Tag = $PC
$list2.Items.Add($item2) > $null
} #End foreach
$progress2.visible = $false
$lblpc.visible = $true
$form2.Text = "Select Computer"
} #End function updatepclist
#Save the initial state of the form
$InitialFormWindowState2 = $form2.WindowState
#Init the OnLoad event to correct the initial state of the form
$form2.add_Load($OnLoadForm_StateCorrection2)
$form2.add_Load({updatepclist})
#Show the Form
$form2.ShowDialog()| Out-Null
}
################
#### FORM 2 ####
################
#Generated Form Function
function GenerateForm {
# Import the Assemblies
[reflection.assembly]::loadwithpartialname("System.Drawing") | Out-Null
[reflection.assembly]::loadwithpartialname("System.Windows.Forms") | Out-Null
[System.Windows.Forms.Application]::EnableVisualStyles();
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') | Out-Null
$InitialFormWindowState = New-Object System.Windows.Forms.FormWindowState
$vbmsg = new-object -comobject wscript.shell
###################
#### PC SEARCH ####
###################
$btn0_OnClick=
{
$computername = $txt1.text
$logPC = $txt1.text
$btn10.visible = $false
$btn11.Visible = $false
if($computername.length -lt 4){$vbpcsearch = $vbmsg.popup("Search queries must include at least four characters.",0,"Error",0)}
else{FormPCSearch}
if(test-path $lfile){(get-date -uformat "%Y-%m-%d-%H:%M") + "," + $user + "," + $logpc + "," + "Search for PC," + $txt1.text | out-file -filepath $lfile -append}
}
#####################
#### SYSTEM INFO ####
#####################
$btn1_OnClick=
{
if ($txt1.text -eq "." -OR $txt1.text -eq "localhost"){$txt1.text = hostname}
$computername = $txt1.text
$stBar1.text = "Pinging " + $computername.ToUpper()
$lbl2.text = ""
HideUnusedItems
if (test-connection $computername -quiet -count 1){
$stBar1.text = "System Info for " + $computername.ToUpper() + " (Loading...)"
$list1.visible = $false
$lbl2.visible = $true
$systeminfoerror = $null
# Begin query #
$rComp = gwmi win32_computersystem -computername $computername -ev systeminfoerror
if ($systeminfoerror){$stBar1.text = "Error retrieving info from " + $computername.ToUpper()}
else {
$rOS = gwmi win32_operatingsystem -computername $computername
$rComp2 = gwmi win32_computersystemproduct -computername $computername
$rCPU = gwmi win32_processor -computername $computername
$rBIOS = gwmi win32_bios -computername $computername
$rRam = gwmi win32_physicalmemory -computername $computername
$rIP = gwmi win32_networkadapterconfiguration -computername $computername -EA Stop | ? {$_.IPEnabled}
$rMon = gwmi win32_desktopmonitor -computername $computername -filter "Availability='3'"
$rVid = gwmi win32_videocontroller -computername $computername
$rDVD = gwmi win32_cdromdrive -computername $computername
$rHD = gwmi win32_logicaldisk -computername $computername -filter "Drivetype='3'"
$rProc = gwmi win32_process -ComputerName $computername
$rOU = Get-QADComputer $computername
# Symantec Info #
$ProductVer = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine',$rComp.name).OpenSubKey('SOFTWARE\Symantec\Symantec Endpoint Protection\CurrentVersion').GetValue('PRODUCTNAME')
$EngineVer = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine',$rComp.name).OpenSubKey('SOFTWARE\Symantec\Symantec Endpoint Protection\CurrentVersion').GetValue('PRODUCTVERSION')
$DatVer = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine',$rComp.name).OpenSubKey('SOFTWARE\Symantec\Symantec Endpoint Protection\CurrentVersion\public-opstate').GetValue('LastVirusDefsRevision')
$DatDate = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine',$rComp.name).OpenSubKey('SOFTWARE\Symantec\Symantec Endpoint Protection\CurrentVersion\public-opstate').GetValue('LastSuccessfulScanDateTime')
# Separate sticks of memory #
$RAM = $rComp.totalphysicalmemory / 1GB
$mem = "{0:N2}" -f $RAM + " GB Usable -- "
$memcount = 0
foreach ($stick in $rRam){
$mem += "(" + "$($rRam[$memcount].capacity / 1GB) GB" + ") "
$memcount += 1
}
$mem += "Physical Stick(s)"
# Enumerate Monitors #
$monitor = ""
foreach ($mon in $rmon) {
$monitor += "(" + $mon.screenwidth + " x " + $mon.screenHeight + ") "
}
# List IP/MAC Address #
$IP = $rIP.IPAddress
$MAC = $rIP.MACAddress
if ($rIP.count)
{
$IP = $rIP[0].IPAddress
$MAC = $rIP[0].MACAddress
}
# Convert Date fields #
$imagedate = [System.Management.ManagementDateTimeconverter]::ToDateTime($rOS.InstallDate)
$localdate = [System.Management.ManagementDateTimeconverter]::ToDateTime($rOS.LocalDateTime)
# Format Hard Disk sizes #
$HDfree = $rHD.Freespace / 1GB
$HDSize = $rHD.Size / 1GB
# Screensaver Activity #
$TimeSS = $rProc | ?{$_.Name -match ".scr"}
if (!$TimeSS)
{
$Screensaver = "Not Active"
}
else{
$Screensaver = "{0:N2}" -f (Compare-DateTime -TimeOfObject $TimeSS -Property "CreationDate")
}
# User Logon Duration #
$explorer = $rProc | ?{$_.name -match "explorer.exe"}
if (!$explorer)
{
$userlogonduration = $null
}
elseif ($explorer.count)
{
$explorer = $explorer | sort creationdate
$UserLogonDuration = $explorer[0]
}
else
{
$UserLogonDuration = $explorer
}
if ($UserLogonDuration){$ULD = Compare-DateTime $UserLogonDuration "CreationDate"}
else{$ULD = ""}
<##>
# Desktop/My Documents folder sizes #
if ($rComp.Username -eq $null){}
else {
if ($rOS.Caption -match "Windows 7" -OR "Vista"){$userpath = "users\"; $mydocs = "\Documents"}
if ($rOS.Caption -match "XP"){$userpath = "documents and settings\"; $mydocs = "\Mes Documents"}
$path = "\\$computername\c$\$userpath"
$username = $rComp.Username
if ($username.indexof("\") -ne -1){$username = $username.remove(0,$username.lastindexof("\")+1)}
# Desktop Folder Size
$startFolder1 = $path + $username + "\Desktop"
$colItems1 = (Get-ChildItem $startFolder1 -recurse| Measure-Object -property length -sum)
$rDesk = "{0:N2}" -f ($colItems1.sum / 1MB)
# My Documents Folder Size
$startFolder2 = $path + $username + $mydocs
$colItems2 = (Get-ChildItem $startFolder2 -recurse| Measure-Object -property length -sum)
$rMyDoc = "{0:N2}" -f ($colItems2.sum / 1MB)
}
# Computer Temp #
$t = Get-WmiObject MSAcpi_ThermalZoneTemperature -Namespace "root/wmi" -computername $computername
$currentTempKelvin = $t.CurrentTemperature / 10
$currentTempCelsius = $currentTempKelvin - 273.15
# Test Port VNC #
$VNCTEST = Test-NetConnection $computername -Port 5900 -InformationLevel Quiet
# Write query results #
$lbl2.text += "Computer Name:`t" + $rComp.name + "`n"
$lbl2.text += "Domain Location:`t" + $rOU.ParentContainer + "`n"
$lbl2.text += "Current User:`t" + $rComp.username + "`n"
$lbl2.text += "User logged on for:`t" + $ULD + "`n"
$lbl2.text += "Screensaver Time:`t" + $Screensaver + "`n"
$lbl2.text += "VNC Actif:`t" + $VNCTEST + "`n"
$lbl2.text += "Last Restart:`t" + (Compare-DateTime -TimeOfObject $rOS -Property "Lastbootuptime") + "`n`n"
$lbl2.text += "Manufacturer:`t" + $rComp.Manufacturer + "`n"
$lbl2.text += "Model:`t`t" + $rComp.Model + "`n"
$lbl2.text += "Chassis:`t`t" + $rComp2.Version + "`n"
$lbl2.text += "Serial:`t`t" + $rBIOS.SerialNumber + "`n`n"
$lbl2.text += "CPU:`t`t" + $rCPU.Name.Trim() + "`n"
$lbl2.text += "RAM:`t`t" + $mem + "`n"
$lbl2.text += "Temp Celsius:`t`t" + $currentTempCelsius + "`n"
$lbl2.text += "Hard Drive: `t{0:N1} GB Free / {1:N1} GB Total `n" -f $HDfree, $HDsize
$lbl2.text += "Optical Drive:`t" + "(" + $rDVD.Drive + ") " + $rDVD.Caption + "`n"
$lbl2.text += "Video Card:`t" + $rVid.Name + "`n"
$lbl2.text += "Monitor(s):`t" + $monitor + "`n`n"
$lbl2.text += "Local Date/Time:`t" + $localdate + "`n"
$lbl2.text += "Operating System:`t" + $rOS.Caption + "`n"
$lbl2.text += "Service Pack:`t" + $rOS.CSDVersion + "`n"
$lbl2.text += "OS Architecture:`t" + $rComp.SystemType + "`n"
$lbl2.text += "PC imaged on:`t" + $imagedate + "`n`n"
$lbl2.text += "IP Address:`t" + $IP + "`n"
$lbl2.text += "MAC Address:`t" + $MAC + "`n`n"
$lbl2.text += "Symantec Version:`t" + $ProductVer + "`n"
$lbl2.text += "Symantec Engine:`t" + $EngineVer + "`n"
$lbl2.text += "Symantec Version:`t" + $DatVer + "`n"
$lbl2.text += "Last Scan:`t" + $DatDate + "`n`n"
# Desktop/My Docs labels #
if ($rComp.Username -eq $null){}
else {
$lbl2.text += "Desktop Folder:`t" + $rDesk + " MB" + "`n"
$lbl2.text += "My Docs Folder:`t" + $rMyDoc + " MB"
}
$stBar1.text = "System Info for " + $computername.ToUpper()
}
}
else{
$stBar1.text = "Could not contact " + $computername.ToUpper()
}
if(test-path $lfile){(get-date -uformat "%Y-%m-%d-%H:%M") + "," + $user + "," + $computername + "," + "System Info" | out-file -filepath $lfile -append}
}
######################
#### LOCAL ADMINS ####
######################
$btn2_OnClick=
{
if ($txt1.text -eq "." -OR $txt1.text -eq "localhost"){$txt1.text = hostname}
$computername = $txt1.text
$stBar1.text = "Pinging " + $computername.ToUpper()
HideUnusedItems
if (test-connection $computername -quiet -count 1){
$stBar1.text = "Local Admins on " + $computername.ToUpper() + " (Loading...)"
$list1.visible = $true
$lbl2.visible = $false
$list1.Columns[0].text = "Domain"
$list1.Columns[0].width = 129
$list1.Columns[1].text = "User"
$list1.Columns[1].width = ($list1.width - $list1.columns[0].width - 25)
$List1.items.Clear()
$localgroupName = "Administrateurs"
if ($computerName -eq "") {$computerName = "$env:computername"}
if([ADSI]::Exists("WinNT://$computerName/$localGroupName,group")) {
$group = [ADSI]("WinNT://$computerName/$localGroupName,group")
$members = @()
$Group.Members() |
% {
$AdsPath = $_.GetType().InvokeMember("Adspath", 'GetProperty', $null, $_, $null)
# Domain members will have an ADSPath like WinNT://DomainName/UserName.
# Local accounts will have a value like WinNT://DomainName/ComputerName/UserName.
$a = $AdsPath.split('/',[StringSplitOptions]::RemoveEmptyEntries)
$name = $a[-1]
$domain = $a[-2]
$class = $_.GetType().InvokeMember("Class", 'GetProperty', $null, $_, $null)
$member = New-Object PSObject
$member | Add-Member -MemberType NoteProperty -Name "Name" -Value $name
$member | Add-Member -MemberType NoteProperty -Name "Domain" -Value $domain
$member | Add-Member -MemberType NoteProperty -Name "Class" -Value $class
$members += $member
}
foreach ($admin in $members){
$item = new-object System.Windows.Forms.ListViewItem($admin.domain)
if ($admin.Name -ne $null){$item.SubItems.Add($admin.Name)}
$item.Tag = $admin
$list1.Items.Add($item) > $null
} #End foreach $admin
$btn12.visible = $true
}
$stBar1.text = "Local Admins on " + $computername.ToUpper()
} #End test-connection
else{$stBar1.text = "Could not contact " + $computername.ToUpper()}
if(test-path $lfile){(get-date -uformat "%Y-%m-%d-%H:%M") + "," + $user + "," + $computername + "," + "Local Admins" | out-file -filepath $lfile -append}
} #End Local Admins
$btn15_OnClick=
{
$users = (Get-ADUser -Identity $txt1.text -Properties *)
$lbl2.text = ""
$lbl2.text += "User Name:`t" + $users.CN + "`n"
$lbl2.text += "User Company:`t" + $users.Company + "`n"
$lbl2.text += "User Email:`t" + $users.EmailAddress + "`n"
$lbl2.text += "User Service:`t" + $users.Department + "`n"
$lbl2.text += "User Phone :`t" + $users.OfficePhone + "`n"
$lbl2.text += "`n"
$lbl2.text += "User creating:`t" + $users.Created + "`n"
$lbl2.text += "User Last Pwd :`t" + $users.PasswordLastSet + "`n"
$lbl2.text += "User Bad Pwd :`t" + $users.LastBadPasswordAttempt + "`n"
$lbl2.text += "`n"
$lbl2.text += "User Member:`t" + $users.MemberOf + "`n"
$lbl2.text += "`n"
}
######################
#### APPLICATIONS ####
######################
$btn3_OnClick=
{
if ($txt1.text -eq "." -OR $txt1.text -eq "localhost"){$txt1.text = hostname}
$computername = $txt1.text
$stBar1.text = "Pinging " + $computername.ToUpper()
$lbl2.text = ""
HideUnusedItems
if (test-connection $computername -quiet -count 1){
$stBar1.text = "Applications on " + $computername.ToUpper() + " (Loading...)"
$list1.visible = $true
$lbl2.visible = $false
$columnnames = "Name","Path"
$list1.Columns[1].text = "Install Date"
$list1.Columns[1].width = 129
$list1.Columns[0].text = "Name"
$list1.Columns[0].width = ($list1.width - $list1.columns[1].width - 25)
$List1.items.Clear()
$systeminfoerror = $null
$software = gwmi win32_product -computername $computername -ev systeminfoerror | sort-object -property Name
if ($systeminfoerror){$stBar1.text = "Error retrieving info from " + $computername.ToUpper()}
else {
$columnproperties = "Name","InstallDate"
foreach ($app in $software) {
$item = new-object System.Windows.Forms.ListViewItem($app.name)
if ($app.InstallDate -ne $null){
$item.SubItems.Add($app.InstallDate)
}
$item.Tag = $app
$list1.Items.Add($item) > $null
}
$btn11.Visible = $true
$stBar1.text = "Applications installed on " + $computername.ToUpper() + " (" + $software.count + ")"
}
} #End wmi error check
else{
$stBar1.text = "Could not contact " + $computername.ToUpper()
}
if(test-path $lfile){(get-date -uformat "%Y-%m-%d-%H:%M") + "," + $user + "," + $computername + "," + "Applications" | out-file -filepath $lfile -append}
} #End Applications
#######################
#### STARTUP ITEMS ####
#######################
$btn8_OnClick=
{
if ($txt1.text -eq "." -OR $txt1.text -eq "localhost"){$txt1.text = hostname}
$computername = $txt1.text
$stBar1.text = "Pinging " + $computername.ToUpper()
$lbl2.text = ""
HideUnusedItems
if (test-connection $computername -quiet -count 1){
$stBar1.text = "Startup items on " + $computername.ToUpper() + " (Loading...)"
$list1.visible = $true
$lbl2.visible = $false
$list1.Columns[0].text = "Name"
$list1.Columns[0].width = 175
$list1.Columns[1].text = "Path"
$list1.Columns[1].width = ($list1.width - $list1.columns[0].width - 25)
$List1.items.Clear()
$startup = gwmi win32_startupcommand -computername $computername
if ($systeminfoerror){$stBar1.text = "Error retrieving info from " + $computername.ToUpper()}
else {
foreach ($start in $startup){
$item = new-object System.Windows.Forms.ListViewItem($start.Caption)
if ($start.Command -ne $null){
$item.SubItems.Add($start.Command)
}
$item.Tag = $start
$list1.Items.Add($item) > $null
}
$stBar1.text = "Startup items on " + $computername.ToUpper() + " (" + $startup.count + ")"
$btn13.Visible = $true
}
} #End wmi error check
else{
$stBar1.text = "Could not contact " + $computername.ToUpper()
}
if(test-path $lfile){(get-date -uformat "%Y-%m-%d-%H:%M") + "," + $user + "," + $computername + "," + "Startup Items" | out-file -filepath $lfile -append}
} #End startup item list
# Install VNC #
$btn4_OnClick=
{
$computername = $txt1.text
#HideUnusedItems
$stBar1.text = "Installing Ultravnc on " + $computername.ToUpper() + " (please wait...)"
$rComp = gwmi win32_computersystem -computername $computername
$files = "\\" + $computername + "\c$"
if($rComp.SystemType -eq "X86-based PC"){$vncver="c:\ACSA\Ultravnc32.exe"
Copy-Item $vncver $files
psexec \\$computername C:\Ultravnc32.exe /verysilent
$vncpath = "\\" + $computername + "\c$\Program Files\UltraVNC"
$vncpath2 = "c:\Program Files\UltraVNC\winvnc.exe"
Copy-Item c:\ACSA\Ultravnc.ini $vncpath
psexec \\$computername $vncpath2 -install
$stBar1.text = "Installing is Finish on " + $computername.ToUpper() + " (U can use VNC Assisatnce)"
}
if($rComp.SystemType -eq "x64-based PC"){$vncver="c:\ACSA\Ultravnc64.exe"
Copy-Item $vncver $files
psexec \\$computername C:\Ultravnc64.exe /verysilent
$vncpath = "\\" + $computername + "\c$\Program Files\uvnc bvba\UltraVNC\"
$vncpath2 = "C:\Program Files\uvnc bvba\UltraVNC\winvnc.exe"
Copy-Item c:\ACSA\Ultravnc.ini $vncpath
psexec \\$computername $vncpath2 -install
$stBar1.text = "Installing is Finish on " + $computername.ToUpper() + " (U can use VNC Assisatnce)"
}
}
# VNC ASSISTANCE #
$btn5_OnClick=
{
$computername = $txt1.text
HideUnusedItems
$adminOS = gwmi win32_operatingsystem
$stBar1.text = "Startup VNC on " + $computername.ToUpper() + " (Connecting...)"
$vncl = "c:\ACSA\vncviewer.exe" + " " + $computername + " /password XXXXXXX"
iex $vncl
}
# FILE STRUCTURE #
$btn6_OnClick=
{
if ($txt1.text -eq "." -OR $txt1.text -eq "localhost"){$txt1.text = hostname}
$computername = $txt1.text
#HideUnusedItems
$files = "\\" + $computername + "\c$"
explorer $files
if(test-path $lfile){(get-date -uformat "%Y-%m-%d-%H:%M") + "," + $user + "," + $computername + "," + "File Structure" | out-file -filepath $lfile -append}
}
# RESTART COMPUTER #
$btn7_OnClick=
{
if ($txt1.text -eq "." -OR $txt1.text -eq "localhost"){$txt1.text = hostname}
$computername = $txt1.text
HideUnusedItems
$vbrestart = $vbmsg.popup("Are you sure you want to restart " + $computername.ToUpper() + "?",0,"Restart " + $computername.ToUpper() + "?",4)
switch ($vbrestart)
{
6 {
restart-computer -force -computername $computername
if(test-path $lfile){(get-date -uformat "%Y-%m-%d-%H:%M") + "," + $user + "," + $computername + "," + "Restart Computer" | out-file -filepath $lfile -append}
}
7 {}
}
}
######################
#### SHOW-PROCESS ####
######################
$btn9_OnClick=
{
if ($txt1.text -eq "." -OR $txt1.text -eq "localhost"){$txt1.text = hostname}
$computername = $txt1.text
HideUnusedItems
$stBar1.text = "Pinging " + $computername.ToUpper()
if (test-connection $computername -quiet -count 1){
$stBar1.text = "Processes on " + $computername.ToUpper() + " (Loading...)"
$list1.visible = $true
$lbl2.Visible = $false
$List1.items.Clear()
$list1.Columns[0].text = "Name"
$list1.Columns[0].width = 150
$list1.Columns[1].text = "Path"
$list1.Columns[1].width = ($list1.width - $list1.columns[0].width - 25)
$systeminfoerror = $null
$procs = gwmi win32_process -computername $computername -ev systeminfoerror | sort-object -property name
if ($systeminfoerror){$stBar1.text = "Error retrieving info from " + $computername.ToUpper()}
else{
$columnproperties = "Name","ExecutablePath"
foreach ($d in $procs) {
$item = new-object System.Windows.Forms.ListViewItem($d.name)
if ($d.executablepath -ne $null){
$item.SubItems.Add($d.executablepath)
}
$item.Tag = $d
$list1.Items.Add($item) > $null
}
$stBar1.text = "Processes on " + $computername.ToUpper()
$btn10.visible = $true
}
} #End wmi error check
else{
$stBar1.text = "Could not contact " + $computername.ToUpper()
}
if(test-path $lfile){(get-date -uformat "%Y-%m-%d-%H:%M") + "," + $user + "," + $computername + "," + "Processes" | out-file -filepath $lfile -append}
} #End show processs
# END PROCESS #
######################
#### SHOW-PRINTER ####
######################
$btn16_OnClick=
{
if ($txt1.text -eq "." -OR $txt1.text -eq "localhost"){$txt1.text = hostname}
$computername = $txt1.text
HideUnusedItems
$stBar1.text = "Pinging " + $computername.ToUpper()
if (test-connection $computername -quiet -count 1){
$stBar1.text = "Processes on " + $computername.ToUpper() + " (Loading...)"
$list1.visible = $true
$lbl2.Visible = $false
$List1.items.Clear()
$list1.Columns[0].text = "Name"
$list1.Columns[0].width = 150
$list1.Columns[1].text = "ShareName"
$list1.Columns[1].width = ($list1.width - $list1.columns[0].width - 25)
$systeminfoerror = $null
$printers = gwmi Win32_Printer -computername $computername -ev systeminfoerror | sort-object -property name
if ($systeminfoerror){$stBar1.text = "Error retrieving info from " + $computername.ToUpper()}
else{
$columnproperties = "Name","ShareName"
foreach ($d in $printers) {
$item = new-object System.Windows.Forms.ListViewItem($d.name)
if ($d.ShareName -ne $null){
$item.SubItems.Add($d.ShareName)
}
$item.Tag = $d
$list1.Items.Add($item) > $null
}
$stBar1.text = "Processes on " + $computername.ToUpper()
}
} #End wmi error check
else{
$stBar1.text = "Could not contact " + $computername.ToUpper()
}
if(test-path $lfile){(get-date -uformat "%Y-%m-%d-%H:%M") + "," + $user + "," + $computername + "," + "Printer" | out-file -filepath $lfile -append}
} #End show processs
# END PRINTER #
#Rename PC#
$btn17_OnClick=
{
$computername = $txt1.text
$stBar1.text = "Pinging " + $computername.ToUpper()
if (Test-Connection $Computername -quiet -count 1)
{
$stBar1.text = "Renaming " + $computername.ToUpper()
$newPCname = Read-Host "Warning! This will reboot $computername. Enter a new name to continue."
$Cred = Get-credential
$User = ($cred.GetNetworkCredential()).UserName
$pwd = ($cred.GetNetworkCredential()).Password
$cmd = "netdom renamecomputer $computername /newname:$newPCname /userd:$user /passwordd:$pwd /reboot:5 /force"
iex $cmd
$cmd = ""
$pwd = ""
$stBar1.text = "$Computername has been renamed to $NewPCName"
if(test-path $lfile){(get-date -uformat "%Y-%m-%d-%H:%M") + "," + $user + "," + $computername + ",QFix-RenamePC" | out-file -filepath $lfile -append}
}
else{$stBar1.text = "Could not contact " + $computername.ToUpper()}
} #End function Rename-Computer
###########################
#### SHOW-MAPPED DRIVE ####
###########################
$btn18_OnClick=
{
if ($txt1.text -eq "." -OR $txt1.text -eq "localhost"){$txt1.text = hostname}
$computername = $txt1.text
HideUnusedItems
$stBar1.text = "Pinging " + $computername.ToUpper()
if (test-connection $computername -quiet -count 1){
$stBar1.text = "Processes on " + $computername.ToUpper() + " (Loading...)"
$list1.visible = $true
$lbl2.Visible = $false
$List1.items.Clear()
$list1.Columns[0].text = "Drive"
$list1.Columns[0].width = 150
$list1.Columns[1].text = "Path"
$list1.Columns[1].width = ($list1.width - $list1.columns[0].width - 25)
$systeminfoerror = $null
$driveresults = get-MappedDrives $computerName
$driveresults = $driveresults | ConvertFrom-String -PropertyNames Drive, RemotePath, Domain, User, Computer
if ($systeminfoerror){$stBar1.text = "Error retrieving info from " + $computername.ToUpper()}
else{
$columnproperties = "Drive","RemotePath"
foreach ($d in $driveresults) {
$item = new-object System.Windows.Forms.ListViewItem($d.Drive)
if ($d.Drive -ne $null){
$item.SubItems.Add($d.RemotePath)
}
$item.Tag = $d
$list1.Items.Add($item) > $null
}
$stBar1.text = "Processes on " + $computername.ToUpper()
}
} #End wmi error check
else{
$stBar1.text = "Could not contact " + $computername.ToUpper()
}
if(test-path $lfile){(get-date -uformat "%Y-%m-%d-%H:%M") + "," + $user + "," + $computername + "," + "Printer" | out-file -filepath $lfile -append}
} #End show processs
$btn10_OnClick=
{
$computername = $txt1.text
if ($list1.selecteditems.count -gt 1){$vbmsg1 = $vbmsg.popup("You may only select one process to end at a time.",0,"Error",0)}
elseif ($list1.selecteditems.count -lt 1){$vbmsg1 = $vbmsg.popup("Please select a process to end.",0,"Error",0)}
else{
$exprString = '$list1.SelectedItems | foreach-object {$_.tag} | foreach-object {$_.processid}'
$endproc = invoke-expression $exprString
$process = Get-WmiObject -ComputerName $computername -Query "select * from win32_process where processID='$endproc'"
$process.terminate()
if(test-path $lfile){(get-date -uformat "%Y-%m-%d-%H:%M") + "," + $user + "," + $computername + "," + "End Process," + $process.name | out-file -filepath $lfile -append}
start-sleep 1
$List1.items.Clear()
start-sleep 2
$procs = gwmi win32_process -computername $computername | sort-object -property name
$columnproperties = "Name","ExecutablePath"
foreach ($d in $procs) {
$item = new-object System.Windows.Forms.ListViewItem($d.name)
if ($d.executablepath -ne $null){
$item.SubItems.Add($d.executablepath)
}
$item.Tag = $d
$list1.Items.Add($item) > $null
}
}
}
# UNINSTALL APP #
$btn11_OnClick=
{
if ($list1.selecteditems.count -gt 1){$vbmsg1 = $vbmsg.popup("You may only select one application to uninstall at a time.",0,"Error",0)}
elseif ($list1.selecteditems.count -lt 1){$vbmsg1 = $vbmsg.popup("Please select an application to uninstall.",0,"Error",0)}
else{
$exprString = '$list1.SelectedItems | foreach-object {$_.tag} | foreach-object {$_.name}'
$endapp = invoke-expression $exprString
$stBar1.text = "Applications on " + $computername.ToUpper() + " (Uninstalling $($Endapp))"
$uninapp = Get-WmiObject -ComputerName $computername -Query "select * from win32_product where name='$endapp'"
$uninapp.uninstall()
if(test-path $lfile){(get-date -uformat "%Y-%m-%d-%H:%M") + "," + $user + "," + $computername + "," + "Uninstall Application," + $uninapp.name | out-file -filepath $lfile -append}
start-sleep 1
$List1.items.Clear()
$stBar1.text = "Applications on " + $computername.ToUpper() + " (Refreshing...)"
$software = gwmi win32_product -computername $computername | sort-object -property Name
$columnproperties = "Name","InstallDate"
foreach ($app in $software) {
$item = new-object System.Windows.Forms.ListViewItem($app.name)
if ($app.InstallDate -ne $null){
$item.SubItems.Add($app.InstallDate)
}
$item.Tag = $app
$list1.Items.Add($item) > $null
}
$stBar1.text = "Applications installed on " + $computername.ToUpper() + " (" + $software.count + ")"
}
}
# REMOVE ADMIN #
$btn12_OnClick=
{
if ($list1.selecteditems.count -gt 1){$vbmsg1 = $vbmsg.popup("You may only select one account to remove at a time.",0,"Error",0)}
elseif ($list1.selecteditems.count -lt 1){$vbmsg1 = $vbmsg.popup("Please select an account to remove.",0,"Error",0)}
else{
$stBar1.text = "Admins on " + $computername.ToUpper() + " (Removing...)"
$expUser = '$list1.SelectedItems | foreach-object {$_.tag} | foreach-object {$_.name}'
$username = invoke-expression $expUser
$expDomain = '$list1.SelectedItems | foreach-object {$_.tag} | foreach-object {$_.domain}'
$domain = invoke-expression $expDomain
$computer = [ADSI]("WinNT://" + $computername + ",computer")
$Group = $computer.psbase.children.find("administrators")
$Group.Remove("WinNT://" + $domain + "/" + $username)
if(test-path $lfile){(get-date -uformat "%Y-%m-%d-%H:%M") + "," + $user + "," + $computername + "," + "Remove Admin," + $domain + "\" + $username | out-file -filepath $lfile -append}
start-sleep 1
$List1.items.Clear()
$stBar1.text = "Local Admins on " + $computername.ToUpper() + " (Refreshing...)"
$localgroupName = "Administrators"
if ($computerName -eq "") {$computerName = "$env:computername"}
if([ADSI]::Exists("WinNT://$computerName/$localGroupName,group")) {
$group = [ADSI]("WinNT://$computerName/$localGroupName,group")
$members = @()
$Group.Members() |
% {
$AdsPath = $_.GetType().InvokeMember("Adspath", 'GetProperty', $null, $_, $null)
# Domain members will have an ADSPath like WinNT://DomainName/UserName.
# Local accounts will have a value like WinNT://DomainName/ComputerName/UserName.
$a = $AdsPath.split('/',[StringSplitOptions]::RemoveEmptyEntries)
$name = $a[-1]
$domain = $a[-2]
$class = $_.GetType().InvokeMember("Class", 'GetProperty', $null, $_, $null)
$member = New-Object PSObject
$member | Add-Member -MemberType NoteProperty -Name "Name" -Value $name
$member | Add-Member -MemberType NoteProperty -Name "Domain" -Value $domain
$member | Add-Member -MemberType NoteProperty -Name "Class" -Value $class
$members += $member
}
}
foreach ($admin in $members){
$item = new-object System.Windows.Forms.ListViewItem($admin.domain)
if ($admin.Name -ne $null){
$item.SubItems.Add($admin.Name)
}
$item.Tag = $admin
$list1.Items.Add($item) > $null
}
$stBar1.text = "Local Admins on " + $computername.ToUpper()
}
}
# Remove Startup Items Button #
$btn13_OnClick=
{
if ($list1.selecteditems.count -gt 1){$vbmsg1 = $vbmsg.popup("You may only select one account to remove at a time.",0,"Error",0)}
elseif ($list1.selecteditems.count -lt 1){$vbmsg1 = $vbmsg.popup("Please select an account to remove.",0,"Error",0)}
else{
$stBar1.text = "Startup Items on " + $computername.ToUpper() + " (Removing...)"
$expStartUp = '$list1.SelectedItems | foreach-object {$_.tag} | foreach-object {$_.Name}'
$RemStartUp = invoke-expression $expStartUp
$RemoveStartUpItem = Get-WmiObject -ComputerName $computername -Query "select * from win32_startupcommand where name='$RemStartUp'"
foreach($remstitem in $removestartupitem)
{
$path = $remstitem.location #$removestartupitem.location
if($path -match "HKLM")
{
$path = $path.Replace('HKLM\','')
$BaseKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine',$Computername).OpenSubKey($Path, $true)
foreach ($key in $basekey.GetValueNames())
{
if ($key -eq $remstitem.Name)
{
$basekey.DeleteValue($key)
}
}
}
if($path -match "HKU")
{
$vbmsg1 = $vbmsg.popup($remstitem.Name + " is located in the user registry hive and may not be removed fully.",0,"Error",0)
}
if($path -match "Common Startup")
{
$commonxp = "\\" + $computername + "\c$\documents and settings\all users\start menu\programs\startup\" + $remstitem.Command # + ".lnk"
if(test-path $commonxp){remove-item $commonxp}
}
}# End foreach startupitem removal
$List1.items.Clear()
$startup = gwmi win32_startupcommand -computername $computername -filter "User='All Users'"
foreach ($start in $startup){
$item = new-object System.Windows.Forms.ListViewItem($start.Caption)
if ($start.Command -ne $null){
$item.SubItems.Add($start.Command)
}
$item.Tag = $start
$list1.Items.Add($item) > $null
}
$stBar1.text = "Startup items on " + $computername.ToUpper() + " (" + $startup.count + ")"
}
}
# Lock PC #
$btn14_OnClick=
{
$computername = $txt1.text
& PsExec.exe -s -i \\$computername rundll32.exe user32.dll,LockWorkStation using powershell
$stBar1.text = $computername.ToUpper() + "is Locked "
}
Function HideUnusedItems{
$btn10.visible = $false
$btn11.Visible = $false
$btn12.Visible = $false
$btn13.Visible = $false
} #End Function HideUnusedItems
function WSUSLogs
{
$computername = $txt1.text
if (test-connection $computername -quiet -count 1){
Get-WindowsUpdate
} #End Test-Connection
else{$stBar1.text = "Could not contact " + $computername.ToUpper()}
} #End Function WSUSLogs
$FindUser=
{
$findusername = $txt1.text
if ($findusername -eq ""){$vbmsg1 = $vbmsg.popup("Please enter a full or partial username into the textbox.",0,"Error",0)}
else{
$userlist = get-qaduser $findusername | sort name | select Name, samaccountname, Department, Company, Description, telephoneNumber, email
$userlist | out-gridview -title "Find Users"
if (!$userlist){$vbmsg1 = $vbmsg.popup("No users were found matching your query.",0,"Error",0)}
} #End Else
} #End $FindUser
$FindPCUser=
{
$computername = $txt1.text
if($computername.length -lt 4){$vbpcsearch = $vbmsg.popup("Search queries must include at least four characters.",0,"Error",0)}
else{
$pc1 = $computername + "$"
$findPCusername = get-qadcomputer $pc1
if ($findPCusername){
if (test-connection $findpcusername.name -quiet -count 1){
$wmifindpcuser = gwmi win32_computersystem -computername $findpcusername.name
$wmipcusername = $wmifindpcuser.username
if ($wmipcusername.indexof("\") -ne -1){$wmipcusername = $wmipcusername.remove(0,$wmipcusername.lastindexof("\")+1)}
$userlist = get-qaduser $wmipcusername | sort name | select Name, samaccountname, Department, Company, Description, telephoneNumber, email
$userlist | out-gridview -title "Find PC User"
if (!$userlist){$vbmsg1 = $vbmsg.popup("Noone is logged into " + $findpcusername.name.ToUpper(),0,"Error",0)}
} #End Ping
else{$vbmsg1 = $vbmsg.popup("Could not contact " + $findpcusername.name.ToUpper(),0,"Error",0)}
} #End If $FindPCusername
if (!$findPCusername){
$findPCusername = get-qadcomputer $computername
if (!$findPCusername){$vbmsg1 = $vbmsg.popup("No computer was found matching your query. Please try again.",0,"Error",0)}
elseif ($findPCusername.count){$vbmsg1 = $vbmsg.popup("Multiple machines were found matching your query. Please narrow your search.",0,"Error",0)}
else {
if (test-connection $findpcusername.name -quiet -count 1){
$wmifindpcuser = gwmi win32_computersystem -computername $findpcusername.name
$wmipcusername = $wmifindpcuser.username
if ($wmipcusername.indexof("\") -ne -1){$wmipcusername = $wmipcusername.remove(0,$wmipcusername.lastindexof("\")+1)}
$userlist = get-qaduser $wmipcusername | sort name | select Name, samaccountname, Department, Company, Description, telephoneNumber, email
$userlist | out-gridview -title "Find PC User"
if (!$userlist){$vbmsg1 = $vbmsg.popup("Noone is logged into " + $findpcusername.name.ToUpper(),0,"Error",0)}
} #End Ping $Findpcusername.name
else{$vbmsg1 = $vbmsg.popup("Could not contact " + $findpcusername.name.ToUpper(),0,"Error",0)}
} #End Else
} #End If !$FindPCUserName
} #End $Computername.Length -gt 4
} #End $FindPCUser
#############################
#### Windows Update List ####
#############################
function UpdtReport
{
if ($txt1.text -eq "." -OR $txt1.text -eq "localhost"){$txt1.text = hostname}
$computername = $txt1.text
HideUnusedItems
$stBar1.text = "Pinging " + $computername.ToUpper()
if (test-connection $computername -quiet -count 1){
$stBar1.text = "Processes on " + $computername.ToUpper() + " (Loading...)"
$list1.visible = $true
$lbl2.Visible = $false
$List1.items.Clear()
$list1.Columns[0].text = "HotFIxID"
$list1.Columns[0].width = 150
$list1.Columns[1].text = "InstalledOn"
$list1.Columns[1].width = ($list1.width - $list1.columns[0].width - 25)
$systeminfoerror = $null
$Wlist = get-wmiobject -class win32_quickfixengineering -computername $computername | sort-object InstalledOn
if ($systeminfoerror){$stBar1.text = "Error retrieving info from " + $computername.ToUpper()}
else{
$columnproperties = "HotFixID","InstalledOn"
foreach ($d in $Wlist ) {
$item = new-object System.Windows.Forms.ListViewItem($d.HotFIxID)
if ($d.InstalledOn -ne $null){
$dateinst = Get-Date $d.InstalledOn -Format 'dd/MM/yyyy'
$item.SubItems.Add($dateinst)
}
$item.Tag = $d
$list1.Items.Add($item) > $null
}
$stBar1.text = "Processes on " + $computername.ToUpper()
}
} #End wmi error check
else{
$stBar1.text = "Could not contact " + $computername.ToUpper()
}
if(test-path $lfile){(get-date -uformat "%Y-%m-%d-%H:%M") + "," + $user + "," + $computername + "," + "Printer" | out-file -filepath $lfile -append}
}
# Windows Update #
function EventViewer
{
$computername = $txt1.text
$eventvwr = "eventvwr.exe $computername"
iex $eventvwr
}
function UsersGroups
{
$computername = $txt1.text
$UserGrps = "lusrmgr.msc -a /computer=$computername"
iex $UserGrps
}
function Services
{
$computername = $txt1.text
$Services = "services.msc /computer=$computername"
iex $Services
}
function Compare-DateTime($TimeOfObject,$Property)
{
$TimeOfObject = $TimeOfObject.converttodatetime($TimeOfObject.$Property)
$TimeOfObject = (get-date) - $TimeOfObject
$days = " Day "
if ($TimeOfObject.days -ne 1){$days = $days.replace('Day ','Days ')}
$hours = " Hour "
if ($TimeOfObject.hours -ne 1){$hours = $hours.replace('Hour ','Hours ')}
$minutes = " Minute "
if ($TimeOfObject.minutes -ne 1){$minutes = $minutes.replace('Minute ','Minutes ')}
$TimeComparison = $TimeOfObject.days.tostring() + $days + $TimeOfObject.hours.tostring() + $hours + $TimeOfObject.minutes.tostring() + $minutes
if ($TimeOfObject.days -eq 0){$TimeComparison = $TimeComparison.Replace('0 Days ','')}
if ($TimeOfObject.days -eq 0 -AND $TimeOfObject.hours -eq 0){$TimeComparison = $TimeComparison.Replace('0 Hours ','')}
return $TimeComparison
}
function Update-FormTitle
{
$form1.Text = "DROBIN Admin Tool $Version - Connected to $((Get-QADRootDSE).dnshostname)"
}
function Reset-SUSClientID
{
$computername = $txt1.text
$stBar1.text = "Pinging " + $computername.ToUpper()
if (Test-Connection $Computername -quiet -count 1)
{
$stBar1.text = "Running Reset WSUS Client ID on " + $computername.ToUpper()
$service = "wuauserv"
$pcservice = gwmi win32_service -computername $computername -filter "name='$service'"
$stopsvc = $pcservice.stopservice()
do {
start-sleep -m 500
$pcservice = gwmi win32_service -computername $computername -filter "name='$service'"
}
while ($pcservice.state -eq "Running")
if ($stopsvc.returnvalue -eq 0){"$service stopped on $computername"}
else{"Error stopping $service on $computername"}
$reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $computerName)
$regKey = $reg.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\WindowsUpdate", $true)
if ($regkey.getvalue("SUSclientid")){$regkey.deletevalue("SUSclientid")}
if ($regkey.getvalue("SusClientIdValidation")){$regkey.deletevalue("SusClientIdValidation")}
if ($regkey.getvalue("PingID")){$regkey.deletevalue("PingID")}
if ($regkey.getvalue("AccountDomainSid")){$regkey.deletevalue("AccountDomainSid")}
<#
$SDpath = "\\$computername\c$\Windows\SoftwareDistribution.old"
if (test-path $SDpath){remove-item $SDpath -recurse}
rename-item -path \\$computername\c$\Windows\SoftwareDistribution -newname $SDpath
#>
start-sleep -m 500
$startsvc = $pcservice.startservice()
start-sleep -m 500
if ($startsvc.returnvalue -eq 0){"$service started on $computername"}
else{"Error starting $service on $computername"}
$cmd = "cmd.exe /c psexec.exe \\$computername -d C:\windows\system32\wuauclt.exe /resetauthorization /detectnow"
$CheckForUpdates = Invoke-Expression $cmd
$stBar1.text = "Reset WSUS Client ID completed on " + $computername.ToUpper()
if(test-path $lfile){(get-date -uformat "%Y-%m-%d-%H:%M") + "," + $user + "," + $computername + ",QFix-ResetWSUSClientID" | out-file -filepath $lfile -append}
}
else{$stBar1.text = "Could not contact " + $computername.ToUpper()}
} #End function Reset-SUSClientID
function Update-GroupPolicy
{
$computername = $txt1.text
$stBar1.text = "Pinging " + $computername.ToUpper()
if (Test-Connection $Computername -quiet -count 1)
{
$stBar1.text = "Updating Group Policy on " + $computername.ToUpper()
$cmd = "cmd.exe /c psexec.exe \\$computername -d gpupdate /force"
$GroupPolicy = Invoke-Expression $cmd
$stBar1.text = "Group Policy updated on " + $computername.ToUpper()
if(test-path $lfile){(get-date -uformat "%Y-%m-%d-%H:%M") + "," + $user + "," + $computername + ",QFix-GPUpdate" | out-file -filepath $lfile -append}
}
else{$stBar1.text = "Could not contact " + $computername.ToUpper()}
} #End function Update-GroupPolicy
function View-GroupPolicyComp
{
$computername = $txt1.text
$stBar1.text = "Pinging " + $computername.ToUpper()
if (Test-Connection $Computername -quiet -count 1)
{
$stBar1.text = "Load Group Policy on " + $computername.ToUpper()
$sessions = Get-WmiObject -ComputerName $ComputerName -Class win32_process | ?{$_.name -eq "explorer.exe"}
$owner = $sessions.GetOwner()
$owner = $owner.user
Remove-Item -Path c:\ACSA\$computername.html -Force
GPResult /s $computername /USER $owner /h c:\ACSA\$computername.html
Invoke-Item c:\ACSA\$computername.html
if(test-path $lfile){(get-date -uformat "%Y-%m-%d-%H:%M") + "," + $user + "," + $computername + ",LoadGPO" | out-file -filepath $lfile -append}
}
else{$stBar1.text = "Could not contact " + $computername.ToUpper()}
} #End
function Invoke-WSUSReport
{
$computername = $txt1.text
$stBar1.text = "Pinging " + $computername.ToUpper()
if (Test-Connection $Computername -quiet -count 1)
{
$stBar1.text = "Reporting into WSUS on " + $computername.ToUpper()
$cmd = "cmd.exe /c psexec.exe \\$computername -d usoclient.exe /reportnow"
$WSUSUpdate = Invoke-Expression $cmd
$stBar1.text = "WSUS reporting started on " + $computername.ToUpper()
if(test-path $lfile){(get-date -uformat "%Y-%m-%d-%H:%M") + "," + $user + "," + $computername + ",QFix-WSUSReport" | out-file -filepath $lfile -append}
}
else{$stBar1.text = "Could not contact " + $computername.ToUpper()}
} # End function Invoke-WSUSReport
function Invoke-WSUSDetect
{
$computername = $txt1.text
$stBar1.text = "Pinging " + $computername.ToUpper()
if (Test-Connection $Computername -quiet -count 1)
{
$stBar1.text = "Checking into WSUS on " + $computername.ToUpper()
$cmd = "cmd.exe /c psexec.exe \\$computername -d usoclient.exe /detectnow"
$WSUSUpdate = Invoke-Expression $cmd
$stBar1.text = "WSUS detect started on " + $computername.ToUpper()
if(test-path $lfile){(get-date -uformat "%Y-%m-%d-%H:%M") + "," + $user + "," + $computername + ",QFix-WSUSDetect" | out-file -filepath $lfile -append}
}
else{$stBar1.text = "Could not contact " + $computername.ToUpper()}
} # End function Invoke-WSUSReport
function Get-MappedDrives($ComputerName){
$output = @()
if(Test-Connection -ComputerName $ComputerName -Count 1 -Quiet){
$Hive = [long]$HIVE_HKU = 2147483651
$sessions = Get-WmiObject -ComputerName $ComputerName -Class win32_process | ?{$_.name -eq "explorer.exe"}
if($sessions){
foreach($explorer in $sessions){
$sid = ($explorer.GetOwnerSid()).sid
$owner = $explorer.GetOwner()
$RegProv = get-WmiObject -List -Namespace "root\default" -ComputerName $ComputerName | Where-Object {$_.Name -eq "StdRegProv"}
$DriveList = $RegProv.EnumKey($Hive, "$($sid)\Network")
if($DriveList.sNames.count -gt 0){
foreach($drive in $DriveList.sNames){
$output += "$($drive)`t$(($RegProv.GetStringValue($Hive, "$($sid)\Network\$($drive)", "RemotePath")).sValue)`t$($owner.Domain)`t$($owner.user)`t$($ComputerName)"
}
}else{write-debug "No mapped drives on $($ComputerName)"}
}
}else{write-debug "explorer.exe not running on $($ComputerName)"}
}else{write-debug "Can't connect to $($ComputerName)"}
return $output
}
function SortListView {
Param(
[System.Windows.Forms.ListView]$sender,
$column
)
$temp = $sender.Items | Foreach-Object { $_ }
$Script:SortingDescending = !$Script:SortingDescending
$sender.Items.Clear()
$sender.ShowGroups = $false
$sender.Sorting = 'none'
$sender.Items.AddRange(($temp | Sort-Object -Descending:$script:SortingDescending -Property @{ Expression={ $_.SubItems[$column].Text } }))
}
$SetDomain=
{
$CTD = [Microsoft.VisualBasic.Interaction]::InputBox("Enter a domain to connect to", "Connect to domain", "")
if ($CTD){
Connect-QADService $CTD
Update-FormTitle
}
}
$OnLoadForm_StateCorrection=
{
$form1.WindowState = $InitialFormWindowState #Correct the initial state of the form to prevent the .Net maximized form issue
}
#----------------------------------------------
#region Generated Form Code
$form1 = New-Object System.Windows.Forms.Form
Update-FormTitle
$form1.Name = "form1"
$form1.DataBindings.DefaultDataSourceUpdateMode = 0
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 750
$System_Drawing_Size.Height = 661
$form1.ClientSize = $System_Drawing_Size
$form1.StartPosition = "CenterScreen"
$Form1.KeyPreview = $True
$Form1.Add_KeyDown({if ($_.KeyCode -eq "Escape")
{$Form1.Close()}})
# Menu Strip #
$MenuStrip = new-object System.Windows.Forms.MenuStrip
$MenuStrip.backcolor = "ControlLight"
$FileMenu = new-object System.Windows.Forms.ToolStripMenuItem("&File")
$ViewMenu = new-object System.Windows.Forms.ToolStripMenuItem("&View")
$WinUpdtM = new-object System.Windows.Forms.ToolStripMenuItem("&WSUS")
$GPO = new-object System.Windows.Forms.ToolStripMenuItem("&GPO")
$FileDomain = new-object System.Windows.Forms.ToolStripMenuItem("Connect to domain...")
$FileDomain.add_Click($SetDomain)
$FileMenu.DropDownItems.Add($FileDomain) > $null
$FileUser = new-object System.Windows.Forms.ToolStripMenuItem("Find &User in AD")
$FileUser.add_Click($FindUser)
$FileMenu.DropDownItems.Add($FileUser) > $null
$FilePCUser = new-object System.Windows.Forms.ToolStripMenuItem("Find User on &PC")
$FilePCUser.add_Click($FindPCUser)
$FileMenu.DropDownItems.Add($FilePCUser) > $null
$FileExit = new-object System.Windows.Forms.ToolStripMenuItem("E&xit")
$FileExit.add_Click({$form1.close()})
$FileMenu.DropDownItems.Add($FileExit) > $null
$WSUSMenu = new-object System.Windows.Forms.ToolStripMenuItem("&WSUS Logs")
$WinUpdtM.DropdownItems.Add($WSUSMenu) > $null
$WSUSReport = new-object System.Windows.Forms.ToolStripMenuItem("Reporting")
$WSUSReport.add_Click({$WSUSFile = "Report"; WSUSLogs})
$WSUSMenu.DropDownItems.Add($WSUSReport) > $null
$WSUSUpdates = new-object System.Windows.Forms.ToolStripMenuItem("Updates")
$WSUSUpdates.add_Click({$WSUSFile = "Updates"; WSUSLogs})
$WSUSMenu.DropDownItems.Add($WSUSUpdates) > $null
$ViewEventVwr = new-object System.Windows.Forms.ToolStripMenuItem("Event Viewer")
$ViewEventVwr.add_Click({EventViewer})
$ViewMenu.DropdownItems.Add($ViewEventVwr) > $null
$ViewServices = new-object System.Windows.Forms.ToolStripMenuItem("Services")
$ViewServices.add_Click({Services})
$ViewMenu.DropdownItems.Add($ViewServices) > $null
$ViewUsersGroups = new-object System.Windows.Forms.ToolStripMenuItem("Users/Groups")
$ViewUsersGroups.add_Click({UsersGroups})
$ViewMenu.DropdownItems.Add($ViewUsersGroups) > $null
$UpdateReport = new-object System.Windows.Forms.ToolStripMenuItem("Installed KB")
$UpdateReport.add_Click({UpdtReport})
$WinUpdtM.DropdownItems.Add($UpdateReport) > $null
$QFixSUSDetect = new-object System.Windows.Forms.ToolStripMenuItem("WSUS - Detect")
$QFixSUSDetect.add_Click({Invoke-WSUSDetect})
$WinUpdtM.DropdownItems.Add($QFixSUSDetect) > $null
$QFixSUSReport = new-object System.Windows.Forms.ToolStripMenuItem("WSUS - Report")
$QFixSUSReport.add_Click({Invoke-WSUSReport})
$WinUpdtM.DropdownItems.Add($QFixSUSReport) > $null
$QFixSUSClientID = new-object System.Windows.Forms.ToolStripMenuItem("WSUS - Reset Client ID")
$QFixSUSClientID.add_Click({Reset-SUSClientID})
$WinUpdtM.DropdownItems.Add($QFixSUSClientID) > $null
$QFixGPUpdate = new-object System.Windows.Forms.ToolStripMenuItem("Group Policy - Update")
$QFixGPUpdate.add_Click({Update-GroupPolicy})
$GPO.DropdownItems.Add($QFixGPUpdate) > $null
$PCGPUpdate = new-object System.Windows.Forms.ToolStripMenuItem("View GPO COMPUTER")
$PCGPUpdate.add_Click({View-GroupPolicyComp})
$GPO.DropdownItems.Add($PCGPUpdate) > $null
$MenuStrip.Items.Add($FileMenu) > $null
$MenuStrip.Items.Add($ViewMenu) > $null
$MenuStrip.Items.Add($WinUpdtM) > $null
$MenuStrip.Items.Add($GPO) > $null
$form1.Controls.Add($MenuStrip)
# Textbox 1 - Computer Name #
$txt1 = New-Object System.Windows.Forms.TextBox
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 125
$System_Drawing_Size.Height = 20
$txt1.Size = $System_Drawing_Size
$txt1.DataBindings.DefaultDataSourceUpdateMode = 0
$txt1.Name = "txt1"
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 12
$System_Drawing_Point.Y = 30
$txt1.Location = $System_Drawing_Point
$txt1.TabIndex = 0
$form1.Controls.Add($txt1)
# Label 2 - Results #
$lbl2 = New-Object System.Windows.Forms.Richtextbox
$lbl2.TabIndex = 7
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 600
$System_Drawing_Size.Height = ($form1.height - 96)
$lbl2.Size = $System_Drawing_Size
$lbl2.BorderStyle = 2
$lbl2.anchor = "bottom, left, top, right"
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 145
$System_Drawing_Point.Y = 30
$lbl2.Location = $System_Drawing_Point
$lbl2.DataBindings.DefaultDataSourceUpdateMode = 0
$lbl2.Name = "lbl2"
$lbl2.Visible = $true
$form1.Controls.Add($lbl2)
# Group 1 - Information #
$grp1 = New-Object System.Windows.Forms.GroupBox
$grp1.Name = "grp1"
$grp1.Text = "Information & More"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 125
$System_Drawing_Size.Height = 239
$grp1.Size = $System_Drawing_Size
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 12
$System_Drawing_Point.Y = 136
$grp1.Location = $System_Drawing_Point
$grp1.TabStop = $False
$grp1.TabIndex = 4
$grp1.DataBindings.DefaultDataSourceUpdateMode = 0
$form1.Controls.Add($grp1)
# Group 2 - Tools #
$grp2 = New-Object System.Windows.Forms.GroupBox
$grp2.Name = "grp2"
$grp2.Text = "Tools"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 125
$System_Drawing_Size.Height = 204
$grp2.Size = $System_Drawing_Size
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 12
$System_Drawing_Point.Y = 397
$grp2.Location = $System_Drawing_Point
$grp2.TabStop = $False
$grp2.TabIndex = 5
$grp2.DataBindings.DefaultDataSourceUpdateMode = 0
$form1.Controls.Add($grp2)
# Button 0 - PC Search #
$btn0 = New-Object System.Windows.Forms.Button
$btn0.TabIndex = 0
$btn0.Name = "btn0"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 110
$System_Drawing_Size.Height = 25
$btn0.Size = $System_Drawing_Size
$btn0.UseVisualStyleBackColor = $True
$btn0.Text = "&Search for PC"
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 19
$System_Drawing_Point.Y = 56
$btn0.Location = $System_Drawing_Point
$btn0.DataBindings.DefaultDataSourceUpdateMode = 0
$btn0.add_Click($btn0_OnClick)
$form1.Controls.Add($btn0)
# Button 1 - System Info #
$btn1 = New-Object System.Windows.Forms.Button
$btn1.TabIndex = 1
$btn1.Name = "btn1"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 110
$System_Drawing_Size.Height = 25
$btn1.Size = $System_Drawing_Size
$btn1.UseVisualStyleBackColor = $True
$btn1.Text = "System &Info"
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 7
$System_Drawing_Point.Y = 21
$btn1.Location = $System_Drawing_Point
$btn1.DataBindings.DefaultDataSourceUpdateMode = 0
$btn1.add_Click($btn1_OnClick)
$grp1.Controls.Add($btn1)
# Button 2 - Local Admins #
$btn2 = New-Object System.Windows.Forms.Button
$btn2.TabIndex = 2
$btn2.Name = "btn2"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 110
$System_Drawing_Size.Height = 25
$btn2.Size = $System_Drawing_Size
$btn2.UseVisualStyleBackColor = $True
$btn2.Text = "&Local Admins"
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 7
$System_Drawing_Point.Y = 52
$btn2.Location = $System_Drawing_Point
$btn2.DataBindings.DefaultDataSourceUpdateMode = 0
$btn2.add_Click($btn2_OnClick)
$grp1.Controls.Add($btn2)
# Button 3 - Applications #
$btn3 = New-Object System.Windows.Forms.Button
$btn3.TabIndex = 3
$btn3.Name = "btn3"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 110
$System_Drawing_Size.Height = 25
$btn3.Size = $System_Drawing_Size
$btn3.UseVisualStyleBackColor = $True
$btn3.Text = "&Applications"
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 7
$System_Drawing_Point.Y = 83
$btn3.Location = $System_Drawing_Point
$btn3.DataBindings.DefaultDataSourceUpdateMode = 0
$btn3.add_Click($btn3_OnClick)
$grp1.Controls.Add($btn3)
# Button 4 - Install VNC #
$btn4 = New-Object System.Windows.Forms.Button
$btn4.TabIndex = 4
$btn4.Name = "btn4"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 110
$System_Drawing_Size.Height = 25
$btn4.Size = $System_Drawing_Size
$btn4.UseVisualStyleBackColor = $True
$btn4.Text = "Install VNC"
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 7
$System_Drawing_Point.Y = 20
$btn4.Location = $System_Drawing_Point
$btn4.DataBindings.DefaultDataSourceUpdateMode = 0
$btn4.add_Click($btn4_OnClick)
$grp2.Controls.Add($btn4)
# Button 5 - VNC Assistance #
$btn5 = New-Object System.Windows.Forms.Button
$btn5.TabIndex = 5
$btn5.Name = "btn5"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 110
$System_Drawing_Size.Height = 25
$btn5.Size = $System_Drawing_Size
$btn5.UseVisualStyleBackColor = $True
$btn5.Text = "VNC Assistance"
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 7
$System_Drawing_Point.Y = 51
$btn5.Location = $System_Drawing_Point
$btn5.DataBindings.DefaultDataSourceUpdateMode = 0
$btn5.add_Click($btn5_OnClick)
$grp2.Controls.Add($btn5)
# Button 6 - File Structure #
$btn6 = New-Object System.Windows.Forms.Button
$btn6.TabIndex = 6
$btn6.Name = "btn6"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 110
$System_Drawing_Size.Height = 25
$btn6.Size = $System_Drawing_Size
$btn6.UseVisualStyleBackColor = $True
$btn6.Text = "View &C Drive"
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 7
$System_Drawing_Point.Y = 83
$btn6.Location = $System_Drawing_Point
$btn6.DataBindings.DefaultDataSourceUpdateMode = 0
$btn6.add_Click($btn6_OnClick)
$grp2.Controls.Add($btn6)
# Button 7 - Restart Computer #
$btn7 = New-Object System.Windows.Forms.Button
$btn7.TabIndex = 7
$btn7.Name = "btn7"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 110
$System_Drawing_Size.Height = 25
$btn7.Size = $System_Drawing_Size
$btn7.UseVisualStyleBackColor = $True
$btn7.Text = "&Restart Computer"
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 7
$System_Drawing_Point.Y = 115
$btn7.Location = $System_Drawing_Point
$btn7.DataBindings.DefaultDataSourceUpdateMode = 0
$btn7.add_Click($btn7_OnClick)
$grp2.Controls.Add($btn7)
# Button 8 - Startup Items #
$btn8 = New-Object System.Windows.Forms.Button
$btn8.TabIndex = 9
$btn8.Name = "btn8"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 110
$System_Drawing_Size.Height = 25
$btn8.Size = $System_Drawing_Size
$btn8.UseVisualStyleBackColor = $True
$btn8.Text = "Startup I&tems"
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 7
$System_Drawing_Point.Y = 114
$btn8.Location = $System_Drawing_Point
$btn8.DataBindings.DefaultDataSourceUpdateMode = 0
$btn8.add_Click($btn8_OnClick)
$grp1.Controls.Add($btn8)
# Button 9 - Show Processes #
$btn9 = New-Object System.Windows.Forms.Button
$btn9.TabIndex = 10
$btn9.Name = "btn9"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 110
$System_Drawing_Size.Height = 25
$btn9.Size = $System_Drawing_Size
$btn9.UseVisualStyleBackColor = $True
$btn9.Text = "&Processes"
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 7
$System_Drawing_Point.Y = 147
$btn9.Location = $System_Drawing_Point
$btn9.DataBindings.DefaultDataSourceUpdateMode = 0
$btn9.add_Click($btn9_OnClick)
$grp1.Controls.Add($btn9)
# Button 10 - End Process #
$btn10 = New-Object System.Windows.Forms.Button
$btn10.TabIndex = 11
$btn10.Name = "btn10"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 110
$System_Drawing_Size.Height = 25
$btn10.Size = $System_Drawing_Size
$btn10.anchor = "bottom, left"
$btn10.UseVisualStyleBackColor = $True
$btn10.Text = "End Process"
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 19
$System_Drawing_Point.Y = ($form1.height - 90)
$btn10.Location = $System_Drawing_Point
$btn10.DataBindings.DefaultDataSourceUpdateMode = 0
$btn10.add_Click($btn10_OnClick)
$btn10.BackColor = 'Red'
$btn10.Visible = $false
$form1.Controls.Add($btn10)
# Button 11 - Uninstall App #
$btn11 = New-Object System.Windows.Forms.Button
$btn11.TabIndex = 12
$btn11.Name = "btn11"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 110
$System_Drawing_Size.Height = 25
$btn11.Size = $System_Drawing_Size
$btn11.anchor = "bottom, left"
$btn11.UseVisualStyleBackColor = $True
$btn11.Text = "Uninstall App"
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 19
$System_Drawing_Point.Y = ($form1.height - 90)
$btn11.Location = $System_Drawing_Point
$btn11.DataBindings.DefaultDataSourceUpdateMode = 0
$btn11.add_Click($btn11_OnClick)
$btn11.BackColor = 'Red'
$btn11.Visible = $false
$form1.Controls.Add($btn11)
# Button 12 - Remove Admin #
$btn12 = New-Object System.Windows.Forms.Button
$btn12.TabIndex = 13
$btn12.Name = "btn12"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 110
$System_Drawing_Size.Height = 25
$btn12.Size = $System_Drawing_Size
$btn12.anchor = "bottom, left"
$btn12.UseVisualStyleBackColor = $True
$btn12.Text = "Remove Admin"
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 19
$System_Drawing_Point.Y = ($form1.height - 90)
$btn12.Location = $System_Drawing_Point
$btn12.DataBindings.DefaultDataSourceUpdateMode = 0
$btn12.add_Click($btn12_OnClick)
$btn12.BackColor = 'Red'
$btn12.Visible = $false
$form1.Controls.Add($btn12)
# Button 13 - Remove Startup #
$btn13 = New-Object System.Windows.Forms.Button
$btn13.TabIndex = 14
$btn13.Name = "btn13"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 110
$System_Drawing_Size.Height = 25
$btn13.Size = $System_Drawing_Size
$btn13.anchor = "bottom, left"
$btn13.UseVisualStyleBackColor = $True
$btn13.Text = "Remove Item"
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 19
$System_Drawing_Point.Y = ($form1.height - 90)
$btn13.Location = $System_Drawing_Point
$btn13.DataBindings.DefaultDataSourceUpdateMode = 0
$btn13.add_Click($btn13_OnClick)
$btn13.BackColor = 'Red'
$btn13.Visible = $false
$form1.Controls.Add($btn13)
# Button 14 - Lock Computer #
$btn14 = New-Object System.Windows.Forms.Button
$btn14.TabIndex = 15
$btn14.Name = "btn14"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 110
$System_Drawing_Size.Height = 25
$btn14.Size = $System_Drawing_Size
$btn14.UseVisualStyleBackColor = $True
$btn14.Text = "&Lock Computer"
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 7
$System_Drawing_Point.Y = 147
$btn14.Location = $System_Drawing_Point
$btn14.DataBindings.DefaultDataSourceUpdateMode = 0
$btn14.add_Click($btn14_OnClick)
$grp2.Controls.Add($btn14)
# Button 15 - User Search #
$btn15 = New-Object System.Windows.Forms.Button
$btn15.TabIndex = 0
$btn15.Name = "btn0"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 110
$System_Drawing_Size.Height = 25
$btn15.Size = $System_Drawing_Size
$btn15.UseVisualStyleBackColor = $True
$btn15.Text = "&Search for User"
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 19
$System_Drawing_Point.Y = 86
$btn15.Location = $System_Drawing_Point
$btn15.DataBindings.DefaultDataSourceUpdateMode = 0
$btn15.add_Click($btn15_OnClick)
$form1.Controls.Add($btn15)
# Button 16 - Show Printer #
$btn16 = New-Object System.Windows.Forms.Button
$btn16.TabIndex = 10
$btn16.Name = "btn16"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 110
$System_Drawing_Size.Height = 25
$btn16.Size = $System_Drawing_Size
$btn16.UseVisualStyleBackColor = $True
$btn16.Text = "&Printer"
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 7
$System_Drawing_Point.Y = 177
$btn16.Location = $System_Drawing_Point
$btn16.DataBindings.DefaultDataSourceUpdateMode = 0
$btn16.add_Click($btn16_OnClick)
$grp1.Controls.Add($btn16)
# Button 17 - Show Windows Update #
$btn17 = New-Object System.Windows.Forms.Button
$btn17.TabIndex = 11
$btn17.Name = "btn17"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 110
$System_Drawing_Size.Height = 25
$btn17.Size = $System_Drawing_Size
$btn17.UseVisualStyleBackColor = $True
$btn17.Text = "&Rename PC"
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 7
$System_Drawing_Point.Y = 177
$btn17.Location = $System_Drawing_Point
$btn17.DataBindings.DefaultDataSourceUpdateMode = 0
$btn17.add_Click($btn17_OnClick)
$grp2.Controls.Add($btn17)
# Button 18 - Show Mapped Drive #
$btn18 = New-Object System.Windows.Forms.Button
$btn18.TabIndex = 12
$btn18.Name = "btn18"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 110
$System_Drawing_Size.Height = 25
$btn18.Size = $System_Drawing_Size
$btn18.UseVisualStyleBackColor = $True
$btn18.Text = "&Mapped Drive"
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 7
$System_Drawing_Point.Y = 207
$btn18.Location = $System_Drawing_Point
$btn18.DataBindings.DefaultDataSourceUpdateMode = 0
$btn18.add_Click($btn18_OnClick)
$grp1.Controls.Add($btn18)
## Listview 1 ##
$list1 = New-Object System.Windows.Forms.ListView
$list1.DataBindings.DefaultDataSourceUpdateMode = 0
$list1.Name = "list1"
$list1.anchor = "bottom, left, top, right"
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 145
$System_Drawing_Point.Y = 30
$list1.Location = $System_Drawing_Point
$list1.TabIndex = 3
$list1.View = [System.Windows.Forms.View]"Details"
$list1.Size = new-object System.Drawing.Size(600, ($form1.height - 96))
$list1.FullRowSelect = $true
$list1.GridLines = $true
$columnnames = "Name","Path"
$list1.Columns.Add("Name", 150) | out-null
$list1.Columns.Add("Path", 450) | out-null
$list1.add_ColumnClick({SortListView $this $_.Column})
$list1.visible = $false
$form1.Controls.Add($list1)
## Status Bar ##
$stBar1 = New-Object System.Windows.Forms.StatusBar
$stBar1.Name = "stBar1"
$stBar1.Text = "I'm Ready & UMan ?"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 750
$System_Drawing_Size.Height = 22
$stBar1.Size = $System_Drawing_Size
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 0
$System_Drawing_Point.Y = 380
$stBar1.Location = $System_Drawing_Point
$stBar1.DataBindings.DefaultDataSourceUpdateMode = 0
$stBar1.TabIndex = 0
$form1.Controls.Add($stBar1)
#endregion Generated Form Code
$InitialFormWindowState = $form1.WindowState #Save the initial state of the form
$form1.add_Load($OnLoadForm_StateCorrection) #Init the OnLoad event to correct the initial state of the form
$form1.ShowDialog()| Out-Null #Show the Form
} #End Function GenerateForm
# Load Quest ActiveRoles Snapin
$Quest = Get-PSSnapin Quest.ActiveRoles.ADManagement -ea silentlycontinue
if (!$Quest) {
"Loading Quest.ActiveRoles.ADManagement Snapin"
Add-PSSnapin Quest.ActiveRoles.ADManagement
if (!$?) {"Need to install AD Snapin from http://www.quest.com/powershell";exit}
}
Install-Module -Name PSWindowsUpdate
# Enable VB messageboxes
$vbmsg = new-object -comobject wscript.shell
# Get local user/computer info
$user = $env:username
$userPC = $env:computername
$userdomain = $env:userdomain
$lfile = "C:\ACSA\ACSAlogs.log"
$Trace32 = "C:\ACSA\Trace32.exe"
if (!(Test-Path (Join-Path $Env:windir "system32\trace32.exe"))) {Copy-Item $Trace32 (Join-Path $Env:windir "system32")}
$PSExec = "C:\ACSA\psexec.exe"
if (!(Test-Path (Join-Path $Env:windir "system32\psexec.exe"))) {Copy-Item $PSExec (Join-Path $Env:windir "system32")}
$Version = (Get-Item $MyInvocation.MyCommand.Path).LastWriteTime
Add-Type -AssemblyName System.Speech
$text=$args[0]
$synthesizer = New-Object -TypeName System.Speech.Synthesis.SpeechSynthesizer
$userl = ((gwmi win32_computersystem).username).split('\')[1]
$userl = (Get-ADUser -Identity $userl -Properties *)
$userl = $userl.CN
$synthesizer.Speak("Bonjour")
$synthesizer.Speak($userl)
Write-Host @'
________ ________ ___________________________________ __
___ __ )____ ____ __ \_____ ___ __ ___ __ \_ __ \__ __ )___ _/__ | / /
__ __ |_ / / /_ / / / __ `/_ | / / __ /_/ / / / /_ __ |__ / __ |/ /
_ /_/ /_ /_/ /_ /_/ // /_/ /__ |/ /___ _, _// /_/ /_ /_/ /__/ / _ /| /
/_____/ _\__, / /_____/ \__,_/ _____/_(_)_/ |_| \____/ /_____/ /___/ /_/ |_/
/____/
'@
#Call the Function
GenerateForm
Excel Function IP Info Domain Country Zipcode resolver

Don't Miss Activate Microsft HTML ObjectLibray (Alt-F11 / Tools )
Public Function ResolveIP(IpVal As Range)
'Full INFO iP,CountryCode,CountryName,RegionCode,RegionNAme,City,TimeZone
Set xhttp_get = CreateObject("MSXML2.XMLHTTP")
READYSTATE_COMPLETE = 4
With xhttp_get
.Open "Get", "https://freegeoip.app/json/" & IpVal, True
.send
Do Until xhttp_get.readyState = READYSTATE_COMPLETE
DoEvents
Loop
Set xml_doc = New MSHTML.HTMLDocument
xml_doc.body.innerHTML = .responseText
End With
ResolveIP = xml_doc.body.innerHTML
End Function
Public Function ResolveZIPCity(IpVal As Range)
'Get Only ZIPCODE
Set xhttp_get = CreateObject("MSXML2.XMLHTTP")
Dim City As Integer
READYSTATE_COMPLETE = 4
With xhttp_get
.Open "Get", "https://freegeoip.app/json/" & IpVal, True
.send
Do Until xhttp_get.readyState = READYSTATE_COMPLETE
DoEvents
Loop
Set xml_doc = New MSHTML.HTMLDocument
xml_doc.body.innerHTML = .responseText
End With
ResolveZIPCity = Split(xml_doc.body.innerHTML, ",")(6)
ResolveZIPCity = Split(ResolveZIPCity, ":")(1)
ResolveZIPCity = Replace(ResolveZIPCity, """", "", 1)
'ResolveIPCity = xml_doc.body.innerHTML
End Function
Public Function ResolveIPCity(IpVal As Range)
'Get Only City From IP
Set xhttp_get = CreateObject("MSXML2.XMLHTTP")
Dim City As Integer
READYSTATE_COMPLETE = 4
With xhttp_get
.Open "Get", "https://freegeoip.app/json/" & IpVal, True
.send
Do Until xhttp_get.readyState = READYSTATE_COMPLETE
DoEvents
Loop
Set xml_doc = New MSHTML.HTMLDocument
xml_doc.body.innerHTML = .responseText
End With
ResolveIPCity = Split(xml_doc.body.innerHTML, ",")(5)
ResolveIPCity = Split(ResolveIPCity, ":")(1)
ResolveIPCity = Replace(ResolveIPCity, """", "", 1)
'For FrenchFrogs ZIP not resolved
If ResolveIPCity = "" Then
zip = ResolveZIPCity(IpVal)
If zip = "" Then
ResolveIPCity = "NoDataSorry"
Else
READYSTATE_COMPLETE = 4
With xhttp_get
.Open "Get", "https://geo.api.gouv.fr/communes?codePostal=" & zip, True
.send
Do Until xhttp_get.readyState = READYSTATE_COMPLETE
DoEvents
Loop
Set xml_doc = New MSHTML.HTMLDocument
xml_doc.body.innerHTML = .responseText
End With
ResolveIPCity = Split(xml_doc.body.innerHTML, ",")(0)
ResolveIPCity = Split(ResolveIPCity, ":")(1)
ResolveIPCity = Replace(ResolveIPCity, """", "", 1)
End If
End If
'End for Frogs
End Function
Bloom Hue Philips Windows Control Powershell / Contrôler ses ampoules Philips
Control ur hue fom windows . Contrôler ses ampoules Philips avec Windows 7 / 8 / 10 .This script get IP of ur HUE hub and create at the first launch a new user newdeveloper
It acn Switch On / off lights , ramdom colrs, choose a color with windows Dialog
U can download this powershell script (with extra backgroung and ico.) hue.ps1 HERE
Or create a ps1 file :
function do_off
{
$json = '{"on":false}'
callhue
}
function do_on
{
$json = '{"on":true}'
callhue
}
function do_random
{
$json = '{"on":true,"effect":"colorloop"}'
callhue
}
function do_brit
{
$json = '{"on":true,"bri":'+$brithue+'}'
callhue
}
function PickColor
{
$colorDialog = new-object System.Windows.Forms.ColorDialog
$colorDialog.AllowFullOpen = $true
$colorDialog.ShowDialog()
$alpha = $colordialog.color.A
[Double]$red = $colordialog.color.R
[Double]$green = $colordialog.color.G
[Double]$blue = $colordialog.color.B
$error.clear()
do_color
}
function do_color
{
$X = 0.4124*$red + 0.3576*$green + 0.1805*$blue
$Y = 0.2126*$red + 0.7152*$green + 0.0722*$blue
$Z = 0.0193*$red + 0.1192*$green + 0.9505*$blue
$xh = $x / ($x + $y + $z)
$yh = $y / ($x + $z + $z)
$json='{"on":true,"effect":"none","xy":['+$xh+','+$yh+']}'
callhue
}
function callhue
{
Invoke-WebRequest -UseBasicParsing -ContentType "application/json" -Body $json -Uri "http://$iphue/api/newdeveloper/groups/0/action" -Method Put
}
[reflection.assembly]::LoadWithPartialName( "System.Windows.Forms")
$form= New-Object Windows.Forms.Form
$toolTip = New-Object System.Windows.Forms.ToolTip
$form.Text = "By Dav.Robin.free.fr"
$form.Width = 200
$form.Height = 200
$form.Opacity = 0.7
$form.MinimizeBox = $False
$form.MaximizeBox = $False
$form.FormBorderStyle = 'Fixed3D'
$lpath=pwd
$Image = [system.drawing.image]::FromFile("$lpath\fond.jpeg")
$form.BackgroundImage = $Image
$Icon = New-Object system.drawing.icon ("$lpath\hue.ico")
$form.Icon = $Icon
$form.StartPosition = "CenterScreen"
$Form.Add_Shown({$Form.Activate()})
$Label = New-Object System.Windows.Forms.LinkLabel
$label.location = New-Object System.Drawing.Size(35,75)
$label.TextAlign = "MiddleCenter"
$toolTip.SetToolTip($label,"Hack it !")
$buttonoff = New-Object Windows.Forms.Button
$buttonoff.location = New-Object System.Drawing.Size(110,0)
$toolTip.SetToolTip($buttonoff,"Bye !")
$buttonr = New-Object Windows.Forms.Button
$buttonr.location = New-Object System.Drawing.Size(50,100)
$toolTip.SetToolTip($buttonr,"Let's ColorLoop !")
$buttonc = New-Object Windows.Forms.Button
$buttonc.location = New-Object System.Drawing.Size(50,45)
$toolTip.SetToolTip($buttonc,"Pick Color!")
$buttonon = New-Object Windows.Forms.Button
$toolTip.SetToolTip($buttonon,"Wake Up !")
$brit = New-Object Windows.Forms.TrackBar
$brit.location = New-Object System.Drawing.Size(0,135)
$brit.SetRange(0,255)
$brit.Value = 200
$toolTip.SetToolTip($brit,"$brit.Value")
$brit.Width = 180
$buttonon.text = "ON !"
$buttonoff.text = "OFF !"
$buttonr.text = "RANDOM"
$buttonc.text = "COLOR"
$buttonon.add_click({do_on})
$buttonoff.add_click({do_off})
$buttonr.add_click({do_random})
$buttonc.add_click({PickColor})
$Form.Controls.Add($Label)
$form.controls.add($buttonc)
$form.controls.add($buttonon)
$form.controls.add($buttonoff)
$form.controls.add($buttonr)
$form.controls.add($brit)
$brit.add_ValueChanged({
$brithue = $brit.Value
do_brit
})
$a=Invoke-WebRequest -UseBasicParsing -ContentType "application/json" -Uri "https://www.meethue.com/api/nupnp" -Method Get
$iphue=$a.Content.split('"')[7]
$Label.Text = "IP:" + $iphue
$Label.add_Click({[system.Diagnostics.Process]::start("http://$iphue/debug/clip.html")})
$json = '{"on":true,"alert":"select"}'
$check=Invoke-WebRequest -UseBasicParsing -ContentType "application/json" -Body $json -Uri "http://$iphue/api/newdeveloper/groups/0/action" -Method Put
if ($check.Content -like "*unauthorized*"){
$form.Show()
$Label.Location = New-Object System.Drawing.Size(0,0)
$Label.Size = New-Object System.Drawing.Size(200,200)
$Label.Font = New-object System.Drawing.Font('Calibri', 20, [System.Drawing.FontStyle]::Bold, [System.Drawing.GraphicsUnit]::Point,0)
$json='{"devicetype":"test user","username":"newdeveloper"}'
Invoke-WebRequest -UseBasicParsing -ContentType "application/json" -Body $json -Uri "http://$iphue/api/" -Method Post
$i=30
DO{
Start-Sleep -s 1
$Label.Text="Press HUB hue buttom " + $i + "s. left"
$i = $i-1
$check=Invoke-WebRequest -UseBasicParsing -ContentType "application/json" -Body $json -Uri "http://$iphue/api/" -Method Post
}Until($check.Content -like "*newdeveloper*")
$Label.Text="Good ! Launch Again Please"
Start-Sleep -s 3
}
$check=Invoke-WebRequest -UseBasicParsing -ContentType "application/json" -Body $json -Uri "http://$iphue/api/newdeveloper/groups/0/action" -Method Put
$Label.Size = New-Object System.Drawing.Size(100,20)
$form.ShowDialog()
Don't miss to execute set-executionpolicy remotesigned in powershell
It acn Switch On / off lights , ramdom colrs, choose a color with windows Dialog
U can download this powershell script (with extra backgroung and ico.) hue.ps1 HERE
Or create a ps1 file :
function do_off
{
$json = '{"on":false}'
callhue
}
function do_on
{
$json = '{"on":true}'
callhue
}
function do_random
{
$json = '{"on":true,"effect":"colorloop"}'
callhue
}
function do_brit
{
$json = '{"on":true,"bri":'+$brithue+'}'
callhue
}
function PickColor
{
$colorDialog = new-object System.Windows.Forms.ColorDialog
$colorDialog.AllowFullOpen = $true
$colorDialog.ShowDialog()
$alpha = $colordialog.color.A
[Double]$red = $colordialog.color.R
[Double]$green = $colordialog.color.G
[Double]$blue = $colordialog.color.B
$error.clear()
do_color
}
function do_color
{
$X = 0.4124*$red + 0.3576*$green + 0.1805*$blue
$Y = 0.2126*$red + 0.7152*$green + 0.0722*$blue
$Z = 0.0193*$red + 0.1192*$green + 0.9505*$blue
$xh = $x / ($x + $y + $z)
$yh = $y / ($x + $z + $z)
$json='{"on":true,"effect":"none","xy":['+$xh+','+$yh+']}'
callhue
}
function callhue
{
Invoke-WebRequest -UseBasicParsing -ContentType "application/json" -Body $json -Uri "http://$iphue/api/newdeveloper/groups/0/action" -Method Put
}
[reflection.assembly]::LoadWithPartialName( "System.Windows.Forms")
$form= New-Object Windows.Forms.Form
$toolTip = New-Object System.Windows.Forms.ToolTip
$form.Text = "By Dav.Robin.free.fr"
$form.Width = 200
$form.Height = 200
$form.Opacity = 0.7
$form.MinimizeBox = $False
$form.MaximizeBox = $False
$form.FormBorderStyle = 'Fixed3D'
$lpath=pwd
$Image = [system.drawing.image]::FromFile("$lpath\fond.jpeg")
$form.BackgroundImage = $Image
$Icon = New-Object system.drawing.icon ("$lpath\hue.ico")
$form.Icon = $Icon
$form.StartPosition = "CenterScreen"
$Form.Add_Shown({$Form.Activate()})
$Label = New-Object System.Windows.Forms.LinkLabel
$label.location = New-Object System.Drawing.Size(35,75)
$label.TextAlign = "MiddleCenter"
$toolTip.SetToolTip($label,"Hack it !")
$buttonoff = New-Object Windows.Forms.Button
$buttonoff.location = New-Object System.Drawing.Size(110,0)
$toolTip.SetToolTip($buttonoff,"Bye !")
$buttonr = New-Object Windows.Forms.Button
$buttonr.location = New-Object System.Drawing.Size(50,100)
$toolTip.SetToolTip($buttonr,"Let's ColorLoop !")
$buttonc = New-Object Windows.Forms.Button
$buttonc.location = New-Object System.Drawing.Size(50,45)
$toolTip.SetToolTip($buttonc,"Pick Color!")
$buttonon = New-Object Windows.Forms.Button
$toolTip.SetToolTip($buttonon,"Wake Up !")
$brit = New-Object Windows.Forms.TrackBar
$brit.location = New-Object System.Drawing.Size(0,135)
$brit.SetRange(0,255)
$brit.Value = 200
$toolTip.SetToolTip($brit,"$brit.Value")
$brit.Width = 180
$buttonon.text = "ON !"
$buttonoff.text = "OFF !"
$buttonr.text = "RANDOM"
$buttonc.text = "COLOR"
$buttonon.add_click({do_on})
$buttonoff.add_click({do_off})
$buttonr.add_click({do_random})
$buttonc.add_click({PickColor})
$Form.Controls.Add($Label)
$form.controls.add($buttonc)
$form.controls.add($buttonon)
$form.controls.add($buttonoff)
$form.controls.add($buttonr)
$form.controls.add($brit)
$brit.add_ValueChanged({
$brithue = $brit.Value
do_brit
})
$a=Invoke-WebRequest -UseBasicParsing -ContentType "application/json" -Uri "https://www.meethue.com/api/nupnp" -Method Get
$iphue=$a.Content.split('"')[7]
$Label.Text = "IP:" + $iphue
$Label.add_Click({[system.Diagnostics.Process]::start("http://$iphue/debug/clip.html")})
$json = '{"on":true,"alert":"select"}'
$check=Invoke-WebRequest -UseBasicParsing -ContentType "application/json" -Body $json -Uri "http://$iphue/api/newdeveloper/groups/0/action" -Method Put
if ($check.Content -like "*unauthorized*"){
$form.Show()
$Label.Location = New-Object System.Drawing.Size(0,0)
$Label.Size = New-Object System.Drawing.Size(200,200)
$Label.Font = New-object System.Drawing.Font('Calibri', 20, [System.Drawing.FontStyle]::Bold, [System.Drawing.GraphicsUnit]::Point,0)
$json='{"devicetype":"test user","username":"newdeveloper"}'
Invoke-WebRequest -UseBasicParsing -ContentType "application/json" -Body $json -Uri "http://$iphue/api/" -Method Post
$i=30
DO{
Start-Sleep -s 1
$Label.Text="Press HUB hue buttom " + $i + "s. left"
$i = $i-1
$check=Invoke-WebRequest -UseBasicParsing -ContentType "application/json" -Body $json -Uri "http://$iphue/api/" -Method Post
}Until($check.Content -like "*newdeveloper*")
$Label.Text="Good ! Launch Again Please"
Start-Sleep -s 3
}
$check=Invoke-WebRequest -UseBasicParsing -ContentType "application/json" -Body $json -Uri "http://$iphue/api/newdeveloper/groups/0/action" -Method Put
$Label.Size = New-Object System.Drawing.Size(100,20)
$form.ShowDialog()
Arduino Robot Self Balancing With franko Source
Robot SelfBalancing with Arduino, MPU6050 & MotorShieldCode source : http://lukagabric.com/arduino-self-balancing-robot/
Google Hide - Google Egg - Google Tips
Tips , EasterEggs & more & more & more ...Game : https://g.co/doodle/uk3vrq
Doodle : http://www.google.com/doodles
Fonts : https://www.google.com/fonts
Hack : www.google.com/?hl=xx-hacker
Trend : https://www.google.com/trends/
Search : Do a Barrel Roll
Search : Tilt
Search : Zerg Rush
Search : Blink HTML
Search : Webdriver Torso
Search : Conway's Game of Life
Search : answer to life the universe and everything
Search ; réponse de la vie
Search : kerning
Serach : once in a blue moon
Search : 1.5+(sqrt(1-(sqrt(x^2+y^2))^2) + 1 – x^2-y^2) * (sin (10 * (x*3+y/5+7))+1/4) from -1.6 to 1.6
Search : the loneliest number
Link u know maybe :
https://admin.google.com/domain.com/VerifyAdminAccountPasswordReset [*]
Rclean PC Open Source VB.NET HomeMade DIY CCleaner Like
Download exe for Windows Seven 64bits & Windows 8 PRO HEREDownload FULL source HERE
U can edit customize in 5 minutes ur personal Cleaner
- Create a new Visual Basic Project
'RCleaner - Temp file scanning and cleaning software
'THX to Ernest Jr for Acleaner
Imports System.Threading
Imports System.IO
Imports System.Diagnostics.FileVersionInfo
Imports Microsoft.Win32
Public Class frmMain
Private clean As New UniducksCleaner
Private hasTreeNodesExpanded As Boolean = False
Public LocalMachine As RegistryKey = My.Computer.Registry.LocalMachine
Public CurrentUsers As RegistryKey = My.Computer.Registry.CurrentUser
Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim sArgs As String() = System.Environment.GetCommandLineArgs()
If sArgs.Contains("-runasadmin") Then
' Running with elevated privileges
GO()
Else
' Re-launch the current application with elevated privileges
ReDim Preserve sArgs(sArgs.Length + 1)
sArgs(sArgs.Length - 1) = "-runasadmin"
Dim oProcessStartInfo As System.Diagnostics.ProcessStartInfo = _
New ProcessStartInfo( _
Reflection.Assembly.GetEntryAssembly().Location, _
Join(sArgs, " "))
oProcessStartInfo.Verb = "runas"
Dim oProcess As New System.Diagnostics.Process()
With oProcess
' Enable the WaitForExit method
.EnableRaisingEvents = True
.StartInfo = oProcessStartInfo
' Start the process.
.Start()
' Sleep until the process has completed.
Close()
.WaitForExit()
End With
End If
End Sub
Public Sub GO()
Dim info As New UniducksInformation
For Each n As TreeNode In Me.tvwBrowsers.Nodes
n.Checked = True
Next
For Each n As TreeNode In Me.tvwUserSystem.Nodes
n.Checked = True
Next
For Each n As TreeNode In Me.tvwOther.Nodes
n.Checked = True
Next
hasTreeNodesExpanded = True
Me.Panel2.Hide()
Me.Panel1.Show()
Me.tvwBrowsers.ExpandAll()
Me.tvwUserSystem.ExpandAll()
Me.tvwOther.ExpandAll()
Me.tvwBrowsers.Nodes(0).EnsureVisible()
Me.tvwUserSystem.Nodes(0).EnsureVisible()
Me.tvwOther.Nodes(0).EnsureVisible()
Me.lblInformation.Text = info.GetComputerInformation
End Sub
Private Sub btnScan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnScan.Click
Me.lvwTemps.Items.Clear()
Me.btnClean.Enabled = False
Me.btnScan.Enabled = False
Me.lblResults.Text = String.Empty
Me.progressScanning.Style = ProgressBarStyle.Continuous
Me.progressScanning.Value = 0
Dim t As New Thread(AddressOf Initiate)
't.IsBackground = True
t.Start()
End Sub
Private Sub btnClean_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClean.Click
Me.progressScanning.Style = ProgressBarStyle.Continuous
Me.progressScanning.Value = 0
Me.progressScanning.Maximum = Me.clean.FilesToDelete.Count
Dim tDate As New DateTime(Date.Today.Year, Date.Today.Month, Date.Today.Day, Date.Now.Hour, Date.Now.Minute, Date.Now.Second)
Dim pathr As String = Application.ExecutablePath + "rclean" + tDate.ToString("yyyyMMdd_HHmmss") + ".txt"
If File.Exists(pathr) = False Then
' Create a file to write to.
Dim createText As String = "RClean Repport : " + Environment.NewLine
File.WriteAllText(pathr, createText)
End If
Dim appendText As String = TimeOfDay + Environment.NewLine
File.AppendAllText(pathr, appendText)
For Each f In Me.clean.FilesToDelete
Dim fi As New FileInfo(f)
Try
File.AppendAllText(pathr, f)
My.Computer.FileSystem.DeleteFile(f)
Catch ex As Exception
File.AppendAllText(pathr, " ----> !! READONLY !!")
End Try
File.AppendAllText(pathr, Environment.NewLine)
Dim readText As String = File.ReadAllText(pathr)
Console.WriteLine(readText)
progressScanning.PerformStep()
Next
Process.Start(pathr)
End Sub
Private Sub Initiate()
clean.Clear()
Me.progressScanning.Value = 0
Me.progressScanning.InvokeThreadSafeMethod(Sub() Me.progressScanning.Style = ProgressBarStyle.Marquee)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''' Internet Explorer ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
If isTreeNodeChecked(0, 0, Me.tvwBrowsers) Then
If Directory.Exists(InternetExplorerCookies) Then
Dim di As New DirectoryInfoA(InternetExplorerCookies, "Internet Explorer - Cookies", 3, "*.*", True)
clean.Add(di)
End If
If Directory.Exists(InternetExplorerCookiesDomStore) Then
Dim di As New DirectoryInfoA(InternetExplorerCookiesDomStore, "Internet Explorer - Cookies (DOM Store)", 3, "*.*", True)
clean.Add(di)
End If
End If
If isTreeNodeChecked(0, 1, Me.tvwBrowsers) Then
If Directory.Exists(InternetExplorerTemps) Then
Dim di As New DirectoryInfoA(InternetExplorerTemps, "Internet Explorer - Temporary Interent Files", 3, "*.*", True)
clean.Add(di)
End If
End If
If isTreeNodeChecked(0, 2, Me.tvwBrowsers) Then
If Directory.Exists(InternetExplorerHistory) Then
Dim di As New DirectoryInfoA(InternetExplorerHistory, "Internet Explorer - History", 3, "*.*", True)
clean.Add(di)
End If
End If
If isTreeNodeChecked(0, 3, Me.tvwBrowsers) Then
Dim ri As New RegistryInfoA("hkcu", InternetExplorerRecentlyTypedUrls, False, "Internet Explorer - Recently Typed URLs", 3)
clean.Add(ri)
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Chrome '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
If isTreeNodeChecked(1, 0, Me.tvwBrowsers) Then
If Directory.Exists(GoogleChromeCookiesLocalStorage) Then
Dim di As New DirectoryInfoA(GoogleChromeCookiesLocalStorage, "Google Chrome - Cookies (Local Storage)", 1, "*.*", False)
clean.Add(di)
End If
If Directory.Exists(GoogleChromeCookiesDBs) Then
Dim di As New DirectoryInfoA(GoogleChromeCookiesDBs, "Google Chrome - Cookies (DB)", 1, "*.*", True)
clean.Add(di)
End If
If File.Exists(GoogleChromeCookies) Then
Dim fi As New FileInfoA(GoogleChromeCookies, "Google Chrome - Cookies", 1, "*.*")
clean.Add(fi)
End If
End If
If isTreeNodeChecked(1, 1, Me.tvwBrowsers) Then
If Directory.Exists(GoogleChromeCache) Then
Dim di As New DirectoryInfoA(GoogleChromeCache, "Google Chrome - Cache", 1, "*.*", True)
clean.Add(di)
End If
End If
If isTreeNodeChecked(1, 2, Me.tvwBrowsers) Then
If Directory.Exists(GoogleChromeInternetHistory) Then
Dim di As New DirectoryInfoA(GoogleChromeInternetHistory, "Google Chrome - Internet History", 1, "*History*", False)
clean.Add(di)
End If
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Firefox ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
If isTreeNodeChecked(2, 0, Me.tvwBrowsers) Then
If File.Exists(MozillaFireFoxCookies) Then
Dim fi As New FileInfoA(MozillaFireFoxCookies, "Mozilla Firefox - Cookies", 2, "*.*")
clean.Add(fi)
End If
If File.Exists(MozillaFireFoxCookiesWebAppsStore) Then
Dim fi As New FileInfoA(MozillaFireFoxCookiesWebAppsStore, "Mozilla Firefox - Cookies (Web Apps Store)", 2, "*.*")
clean.Add(fi)
End If
End If
If isTreeNodeChecked(2, 1, Me.tvwBrowsers) Then
If File.Exists(MozillaFireFoxDownloads) Then
Dim fi As New FileInfoA(MozillaFireFoxDownloads, "Mozilla Firefox - Download History", 2, "*.*")
clean.Add(fi)
End If
End If
If isTreeNodeChecked(2, 2, Me.tvwBrowsers) Then
If File.Exists(MozillaFireFoxFormHistory) Then
Dim fi As New FileInfoA(MozillaFireFoxFormHistory, "Mozilla Firefox - Form History", 2, "*.*")
clean.Add(fi)
End If
End If
If isTreeNodeChecked(2, 3, Me.tvwBrowsers) Then
If Directory.Exists(MozillaFireFoxCache) Then
Dim di As New DirectoryInfoA(MozillaFireFoxCache, "Mozilla Firefox - Cache", 2, "*.*", True)
clean.Add(di)
End If
End If
If isTreeNodeChecked(2, 4, Me.tvwBrowsers) Then
If File.Exists(MozillaFirefoxSessionStore) Then
Dim fi As New FileInfoA(MozillaFirefoxSessionStore, "Mozilla Firefox - Session Store", 2, "*.*")
clean.Add(fi)
End If
If File.Exists(MozillaFirefoxSessionStoreBackup) Then
Dim fi As New FileInfoA(MozillaFirefoxSessionStoreBackup, "Mozilla Firefox - Session Store (Backup)", 2, "*.*")
clean.Add(fi)
End If
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Safari '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
If isTreeNodeChecked(3, 0, Me.tvwBrowsers) Then
If File.Exists(SafariCache) Then
Dim fi As New FileInfoA(SafariCache, "Safari - Cache", 4, "*.*")
clean.Add(fi)
End If
End If
If isTreeNodeChecked(3, 1, Me.tvwBrowsers) Then
If Directory.Exists(SafariHistory) Then
Dim di As New DirectoryInfoA(SafariHistory, "Safari - History", 4, "*.*", True)
clean.Add(di)
End If
End If
If isTreeNodeChecked(3, 2, Me.tvwBrowsers) Then
If Directory.Exists(SafariWebpagePreviews) Then
Dim di As New DirectoryInfoA(SafariWebpagePreviews, "Safari - Webpage Previews", 4, "*.*", True)
clean.Add(di)
End If
End If
If isTreeNodeChecked(3, 3, Me.tvwBrowsers) Then
If File.Exists(SafariHistoryDownloadsPlist) Then
Dim fi As New DirectoryInfoA(SafariHistoryDownloadsPlist, "Safari - Download History", 4, "*.*")
clean.Add(fi)
End If
End If
If isTreeNodeChecked(3, 4, Me.tvwBrowsers) Then
If File.Exists(SafariHistoryLastSessionPlist) Then
Dim fi As New DirectoryInfoA(SafariHistoryLastSessionPlist, "Safari - Last Session", 4, "*.*")
clean.Add(fi)
End If
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Opera ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
If isTreeNodeChecked(4, 0, Me.tvwBrowsers) Then
If Directory.Exists(OperaCache) Then
Dim di As New DirectoryInfoA(OperaCache, "Opera - Cache", 5, "*.*", True)
clean.Add(di)
End If
If Directory.Exists(OperaOPCache) Then
Dim di As New DirectoryInfoA(OperaOPCache, "Opera - Cache (OP)", 5, "*.*", True)
clean.Add(di)
End If
If Directory.Exists(OperaIconCache) Then
Dim di As New DirectoryInfoA(OperaIconCache, "Opera - Cache (Icons)", 5, "*.*", True)
clean.Add(di)
End If
End If
If isTreeNodeChecked(4, 1, Me.tvwBrowsers) Then
If Directory.Exists(OperaInternetHistory_1) Then
Dim di As New DirectoryInfoA(OperaInternetHistory_1, "Opera - Internet History (1)", 5, "*.*", True)
clean.Add(di)
End If
If File.Exists(OperaInternetHistory_2) Then
Dim fi As New FileInfoA(OperaInternetHistory_2, "Opera - Internet History (2)", 5, "*.*")
clean.Add(fi)
End If
If File.Exists(OperaInternetHistory_3) Then
Dim fi As New FileInfoA(OperaInternetHistory_3, "Opera - Internet History (3)", 5, "*.*")
clean.Add(fi)
End If
If File.Exists(OperaInternetHistory_4) Then
Dim fi As New FileInfoA(OperaInternetHistory_4, "Opera - Internet History (4)", 5, "*.*")
clean.Add(fi)
End If
If File.Exists(OperaInternetHistory_5) Then
Dim fi As New FileInfoA(OperaInternetHistory_5, "Opera - Internet History (5)", 5, "*.*")
clean.Add(fi)
End If
If File.Exists(OperaInternetHistory_6) Then
Dim fi As New FileInfoA(OperaInternetHistory_6, "Opera - Internet History (6)", 5, "*.*")
clean.Add(fi)
End If
End If
If isTreeNodeChecked(4, 2, Me.tvwBrowsers) Then
If File.Exists(OperaCookies) Then
Dim fi As New FileInfoA(OperaCookies, "Opera - Cookies", 5, "*.*")
clean.Add(fi)
End If
End If
If isTreeNodeChecked(4, 3, Me.tvwBrowsers) Then
If Directory.Exists(OperaWebsiteIcon) Then
Dim di As New DirectoryInfoA(OperaWebsiteIcon, "Opera - Website Icons", 5, "*.*", False)
clean.Add(di)
End If
End If
If isTreeNodeChecked(4, 4, Me.tvwBrowsers) Then
If Directory.Exists(OperaCacheTempDownloads) Then
Dim di As New DirectoryInfoA(OperaCacheTempDownloads, "Opera - Download History", 5, "*.*", True)
clean.Add(di)
End If
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Explorer '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
If isTreeNodeChecked(0, 0, Me.tvwUserSystem) Then
If Directory.Exists(WindowsExplorerRecent) Then
Dim di As New DirectoryInfoA(WindowsExplorerRecent, "Windows Explorer - Recent Documents", 6, "*.*", True)
clean.Add(di)
End If
End If
If isTreeNodeChecked(0, 1, Me.tvwUserSystem) Then
If Directory.Exists(WindowsExplorerThumbnailCache) Then
Dim di As New DirectoryInfoA(WindowsExplorerThumbnailCache, "Windows Explorer - Thumbnail Cache", 6, "*.*", True)
clean.Add(di)
End If
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' System '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
If isTreeNodeChecked(1, 0, Me.tvwUserSystem) Then
If Directory.Exists(WindowsTempFiles) Then
Dim di As New DirectoryInfoA(WindowsTempFiles, "System - Windows Temp Files", 7, "*.*", True)
clean.Add(di)
End If
End If
If isTreeNodeChecked(1, 1, Me.tvwUserSystem) Then
If Directory.Exists(UserTemps) Then
Dim di As New DirectoryInfoA(UserTemps, "System - User Temp Files", 7, "*.*", True)
clean.Add(di)
End If
End If
If isTreeNodeChecked(1, 4, Me.tvwUserSystem) Then
If Directory.Exists(WindowsLogFiles) Then
Dim di As New DirectoryInfoA(WindowsLogFiles, "System - Windows Log Files", 7, "*.log", True)
clean.Add(di)
End If
End If
If isTreeNodeChecked(1, 5, Me.tvwUserSystem) Then
If Directory.Exists(WindowsErrorReporting_1) Then
Dim di As New DirectoryInfoA(WindowsErrorReporting_1, "System - Windows Error Reporting - 1", 7, "*.log", True)
clean.Add(di)
End If
If Directory.Exists(WindowsErrorReporting_2) Then
Dim di As New DirectoryInfoA(WindowsErrorReporting_2, "System - Windows Error Reporting - 2", 7, "*.log", True)
clean.Add(di)
End If
If Directory.Exists(WindowsErrorReporting_3) Then
Dim di As New DirectoryInfoA(WindowsErrorReporting_3, "System - Windows Error Reporting - 3", 7, "*.log", True)
clean.Add(di)
End If
If Directory.Exists(WindowsErrorReporting_4) Then
Dim di As New DirectoryInfoA(WindowsErrorReporting_4, "System - Windows Error Reporting - 4", 7, "*.log", True)
clean.Add(di)
End If
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Advanced '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
If isTreeNodeChecked(2, 0, Me.tvwUserSystem) Then
If Directory.Exists(PrefetchData) Then
Dim di As New DirectoryInfoA(PrefetchData, "Advanced - Prefetch Data", 8, "*.*", True)
clean.Add(di)
End If
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' uTorrent '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
If isTreeNodeChecked(0, 0, Me.tvwOther) Then
If Directory.Exists(uTorrentDllImageCache) Then
Dim di As New DirectoryInfoA(uTorrentDllImageCache, "uTorrent - Image Cache", 9, "*.*", True)
clean.Add(di)
End If
If Directory.Exists(uTorrentTempFiles) Then
Dim di As New DirectoryInfoA(uTorrentTempFiles, "uTorrent - Temp Files", 9, "*.*", True)
clean.Add(di)
End If
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Sun Java '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
If isTreeNodeChecked(0, 1, Me.tvwOther) Then
If Directory.Exists(SunJavaCache) Then
Dim di As New DirectoryInfoA(SunJavaCache, "Sun Java - Cache", 9, "*.*", True)
clean.Add(di)
End If
If Directory.Exists(SunJavaSystemCache) Then
Dim di As New DirectoryInfoA(SunJavaSystemCache, "Sun Java - System Cache", 9, "*.*", True)
clean.Add(di)
End If
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''' FileZilla '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
If isTreeNodeChecked(0, 2, Me.tvwOther) Then
If File.Exists(FileZillaRecentServers) Then
Dim fi As New FileInfoA(FileZillaRecentServers, "FileZilla - Recent Servers", 9, "*.*")
clean.Add(fi)
End If
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Paint.NET '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
If isTreeNodeChecked(1, 0, Me.tvwOther) Then
If Directory.Exists(PaintNet) Then
Dim di As New DirectoryInfoA(PaintNet, "Paint.NET - Temp Files", 10, "*.*", True)
clean.Add(di)
End If
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''' Win Media Player '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
If isTreeNodeChecked(2, 0, Me.tvwOther) Then
If Directory.Exists(WindowsMediaPlayer) Then
Dim di As New DirectoryInfoA(WindowsMediaPlayer, "Windows Media Player - Temp Files", 11, "*.*", True)
clean.Add(di)
End If
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''' QuickTime Player '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
If isTreeNodeChecked(2, 1, Me.tvwOther) Then
If Directory.Exists(QuickTimePlayerCache) Then
Dim di As New DirectoryInfoA(QuickTimePlayerCache, "Quick Time Player - Cache", 11, "*.*", True)
clean.Add(di)
End If
If File.Exists(QuickTimerPlayer) Then
Dim fi As New FileInfoA(QuickTimerPlayer, "Quick Time Player - Player Session", 11, "*.*")
clean.Add(fi)
End If
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''' Adobe Flash Player '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
If isTreeNodeChecked(2, 2, Me.tvwOther) Then
If Directory.Exists(AdobeFlashPlayer) Then
Dim di As New DirectoryInfoA(AdobeFlashPlayer, "Adobe Flash Player - Temp Files", 11, "*.*", True)
clean.Add(di)
End If
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' AVG Antivirus '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
If isTreeNodeChecked(3, 0, Me.tvwOther) Then
If Directory.Exists(AvgAntivirus10Log) Then
Dim di As New DirectoryInfoA(AvgAntivirus10Log, "AVG Antivirus - Log Files", 12, "*.log*", True)
clean.Add(di)
Dim di2 As New DirectoryInfoA(AvgAntivirus10Log, "AVG Antivirus - Log Files - XML", 12, "*.xml*", True)
clean.Add(di2)
End If
If Directory.Exists(AvgAntivirus10Backup) Then
Dim di As New DirectoryInfoA(AvgAntivirus10Backup, "AVG Antivirus - Backup Files", 12, "*.*", True)
clean.Add(di)
End If
If Directory.Exists(AvgAntivirus10Misc) Then
Dim di As New DirectoryInfoA(AvgAntivirus10Misc, "AVG Antivirus - Misc Files", 12, "*.*", True)
clean.Add(di)
End If
If Directory.Exists(AvgAntivirus10Temps) Then
Dim di As New DirectoryInfoA(AvgAntivirus10Misc, "AVG Antivirus - Temp Files", 12, "*.*", True)
clean.Add(di)
End If
End If
If isTreeNodeChecked(3, 1, Me.tvwOther) Then
If Directory.Exists(MalwareBytesLogs) Then
Dim di As New DirectoryInfoA(MalwareBytesLogs, "MalwareBytes - Logs", 12, "*.*", True)
clean.Add(di)
End If
If Directory.Exists(MalwareBytesQuarantineBackup) Then
Dim di As New DirectoryInfoA(MalwareBytesQuarantineBackup, "MalwareBytes - Quarantine", 12, "QUAR", True)
clean.Add(di)
Dim di2 As New DirectoryInfoA(MalwareBytesQuarantineBackup, "MalwareBytes - Backup Files", 12, "BACKUP", True)
clean.Add(di2)
End If
End If
If isTreeNodeChecked(3, 2, Me.tvwOther) Then
If Directory.Exists(WindowsDefenderHistoryResource) Then
Dim di As New DirectoryInfoA(WindowsDefenderHistoryResource, "Windows Defender - History Resource", 12, "*.*", True)
clean.Add(di)
End If
If Directory.Exists(WindowsDefenderHistoryQuick) Then
Dim di As New DirectoryInfoA(WindowsDefenderHistoryQuick, "Windows Defender - Quick History", 12, "*.*", True)
clean.Add(di)
End If
End If
If isTreeNodeChecked(3, 3, Me.tvwOther) Then
If Directory.Exists(SpybotSdLogs) Then
Dim di As New DirectoryInfoA(SpybotSdLogs, "Spybot S&D - Logs", 12, "*.*", True)
clean.Add(di)
End If
If Directory.Exists(SpybotSdBackups) Then
Dim di As New DirectoryInfoA(SpybotSdBackups, "Spybot S&D - Backups", 12, "*.*", True)
clean.Add(di)
End If
If File.Exists(SpybotSdIni) Then
Dim fi As New FileInfoA(SpybotSdIni, "Spybot S&D - Statistics", 12, "*.*")
End If
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Visual Studio '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
If isTreeNodeChecked(4, 0, Me.tvwOther) Then
Dim ri As New RegistryInfoA("hkcu", VisualStudio2010FileMRUList, False, "Visual Studio - VS 2010 File MRU List", 13)
Dim ri2 As New RegistryInfoA("hkcu", VisualStudio2010ProjectMRUList, False, "Visual Studio - VS 2010 Project MRU List", 13)
clean.Add(ri)
clean.Add(ri2)
End If
If isTreeNodeChecked(4, 1, Me.tvwOther) Then
Dim ri As New RegistryInfoA("hkcu", VisualStudio2008FileMRUList, False, "Visual Studio - VS 2008 File MRU List", 13)
Dim ri2 As New RegistryInfoA("hkcu", VisualStudio2008ProjectMRUList, False, "Visual Studio - VS 2008 Project MRU List", 13)
clean.Add(ri)
clean.Add(ri2)
End If
If isTreeNodeChecked(4, 2, Me.tvwOther) Then
Dim ri As New RegistryInfoA("hkcu", VisualStudio2005FileMRUList, False, "Visual Studio - VS 2005 File MRU List", 13)
Dim ri2 As New RegistryInfoA("hkcu", VisualStudio2005ProjectMRUList, False, "Visual Studio - VS 2005 Project MRU List", 13)
clean.Add(ri)
clean.Add(ri2)
End If
Me.progressScanning.InvokeThreadSafeMethod(Sub() Me.progressScanning.Style = ProgressBarStyle.Continuous)
Me.btnScan.InvokeThreadSafeMethod(Sub() Me.btnScan.Enabled = False)
Me.btnClean.InvokeThreadSafeMethod(Sub() Me.btnClean.Enabled = False)
Me.progressScanning.InvokeThreadSafeMethod(Sub() Me.progressScanning.PerformStep())
Me.lblResults.InvokeThreadSafeMethod(Sub() Me.lblResults.Text = "Initial Scan Size " & clean.DisplaySize & Environment.NewLine & "Initial File Count " & CStr(clean.FileCount))
clean.Scan(lvwTemps)
Me.btnScan.Enabled = True
Me.btnClean.Enabled = True
End Sub
Private Function isTreeNodeChecked(ByVal indexParent As Integer, ByVal indexChild As Integer, ByVal tvw As TreeView) As Boolean
For Each tn As TreeNode In tvw.GetThreadSafeProperty(Function() tvw.Nodes)
If tn.Checked And tn.Index = indexParent Then
For Each tn2 As TreeNode In tn.Nodes
If tn2.Index = indexChild Then
If tn2.Checked Then
Return True
Else
Return False
End If
End If
Next
End If
Next
End Function
Private Sub tvwBrowsers_AfterCheck(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles tvwBrowsers.AfterCheck, tvwUserSystem.AfterCheck, tvwOther.AfterCheck
If e.Node.Checked Then
For Each n As TreeNode In e.Node.Nodes
n.Checked = True
Next
Else
If hasTreeNodesExpanded Then
For Each n As TreeNode In e.Node.Nodes
n.Checked = False
Next
End If
End If
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
'Registry Button
Me.Panel1.Hide()
Me.Panel2.Show()
Dim Value As String
Dim StartupPaths(0 To 5) As String
ListView1.Clear()
ListView1.Columns.Add("Startup Item")
ListView1.Columns.Add("Command")
ListView1.Columns.Add("Location")
ListView1.View = View.Details
ListView1.CheckBoxes = True
ListView1.FullRowSelect = True
ListView1.Dock = DockStyle.Fill
'Local Machine
StartupPaths(0) = "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce\"
StartupPaths(1) = "SOFTWARE\Microsoft\Windows\CurrentVersion\Run\"
StartupPaths(2) = "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run\"
StartupPaths(3) = "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\RunOnce\"
StartupPaths(4) = "Software\Microsoft\Windows\CurrentVersion\Run\"
StartupPaths(5) = "Software\Microsoft\Windows\CurrentVersion\RunOnce\"
'Cycle through Local Machine Startups paths
For K = 0 To 3
Dim L_M_Keys As RegistryKey = Registry.LocalMachine.OpenSubKey(StartupPaths(K), True)
Dim L_M_subKeys() As String = L_M_Keys.GetValueNames
For Each SubKey As String In L_M_subKeys
Value = CStr(Registry.LocalMachine.GetValue(StartupPaths(K), SubKey, Nothing))
MessageBox.Show(Value)
Dim Value2 As String = Replace(LCase(Value), "%windir%", "c:\windows")
Dim Item As New ListViewItem
Dim Info As FileVersionInfo = Nothing
Dim Exists As Boolean = True
Try
Info = FileVersionInfo.GetVersionInfo(Path.GetDirectoryName(Value2))
Catch
Exists = False
End Try
Try
Item.Text = Info.ProductName '"d" 'SubKey
Catch
Item.Text = SubKey
End Try
'--------------------
'add the location
Item.SubItems.Add(Value)
'add the key
Item.SubItems.Add("HKLM\" & StartupPaths(K))
'add the item to the listview
ListView1.Items.Add(Item)
Next
Next
'Current(Users)
For J = 4 To 5
Dim C_U_Keys As RegistryKey = CurrentUsers.OpenSubKey(StartupPaths(J), False)
Dim C_U_subKeys() As String = C_U_Keys.GetValueNames
For Each SubKey As String In C_U_subKeys
Value = CStr(Registry.CurrentUser.GetValue(StartupPaths(J), SubKey, Nothing))
Dim Value2 As String = Replace(LCase(Value), "%windir%", "c:\windows")
'MessageBox.Show(Value2)
Dim Item As New ListViewItem
'------------------
Dim Info As FileVersionInfo = Nothing
Dim Exists As Boolean = True
Try
Info = FileVersionInfo.GetVersionInfo(Path.GetDirectoryName(Value2))
Catch
Exists = False
End Try
Try
Item.Text = Info.ProductName
Catch
Item.Text = SubKey
End Try
If Value <> "" Then
Item.SubItems.Add(Value)
Item.SubItems.Add("HKLU\" & StartupPaths(J))
ListView1.Items.Add(Item)
ListView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent)
End If
Next
Next
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
'Clean Button
Me.Panel2.Hide()
Me.Panel1.Show()
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs)
End Sub
End Class
COMPRESS EXECUTABLE WITHOUT CHANGE UPX - Win / Linux
Un programme compressé par UPX, signifie qu’il devient illisible tant qu’il n’a pas été décompressé. Le programme permet de compresser un exécutable, utilisant la technologie de compression sans pertes UCL, de sorte que le programme une fois lancé se décompresse lui-même Lorsque UPX compresse un fichier, il greffe à ce fichier ce qu’on appelle le LOADER, qui est donc responsable de la décompression du fichier.Il modifie l’entry-point du programme (qui correspond à l’adresse où commence le programme) pour que ce soit le LOADER qui se charge en premier, décompressant le programme en mémoire qui devient lisible.
Ressource Hacker Hidden Ressource Windows Games / Comment gagner au Solitaire Spider ?
Download Ressource Hacker Here : http://www.angusj.com/resourcehacker/
Launch it & open :
C:\Program Files\Microsoft Games\Solitaire\fr-FR\Solitaire.exe.mui
Go to Menu - 102 & 1036 to view menu of solitaire :

Now Go to Menu 103 - 1036 ... Oh a DEBUG MENU :

To enabble DEBUG menu copy it into 1036 :
POPUP "Debug"
{
MENUITEM "Force Save", 40021
MENUITEM "Force Load", 40022
MENUITEM "Force Win", 40024
MENUITEM "Forcer les victoires chronométrées", 40041
MENUITEM "Force Lose", 40025
MENUITEM "Toggle Deck Lock", 40027
MENUITEM SEPARATOR
MENUITEM "Autoplay", 40028
MENUITEM "Disable Autoplay", 40029
}

To finish compil it (Compil Script) et Save it ... It's Finish :

U can also do it for :
Solitaire: C:\Program Files\Microsoft Games\Solitaire\fr-FR\Solitaire.exe.mui
Spider Solitaire: C:\Program Files\Microsoft Games\SpiderSolitaire\en-US\SpiderSolitaire.exe.mui
FreeCell: C:\Program Files\Microsoft Games\FreeCell\fr-FR\FreeCell.exe.mui
Minesweeper: C:\Program Files\Microsoft Games\Minesweeper\fr-FR\Minesweeper.exe.mui
Hearts: C:\Program Files\Microsoft Games\Hearts\fr-FR\Hearts.exe.mui
Mahjong: C:\Program Files\Microsoft Games\Mahjong\fr-FR\Mahjong.exe.mui
Chess: C:\Program Files\Microsoft Games\Chess\fr-FR\Chess.exe.mui
Purble Place: C:\Program Files\Microsoft Games\Purble Place\fr-FR\PurblePlace.exe.mui
Exsensus OpenSource Home Made Anti Theft Android Part 1 / 3 (WebInterface)
For this new year i give u source of Exsensus an homemade anti Theft / Finder AndroidWhat U Need ? Only a website (U can find it HERE ) and smartphone with Android !
First creating an index.html :
<html>
<FRAMESET COLS="20%,80%">
<FRAME SRC="androidmessages.html" NAME="gauche">
<FRAMESET ROWS="25%, 75%">
<FRAME SRC="top.htm" NAME="droit_haut">
<FRAME SRC="http://maxgif.com/4ln" NAME="droite">
</FRAMESET>
</html>
Now androidmessages.html with only this code:
<html>
<head>
<title>Exsensus</title>
<base target="droite">
</head>
<body bgcolor="black" TEXT="#FFFFFF">
<h1>Exsensus mon Precieux !</h1>
& top.htm :
<html>
<head>
</head>
<body bgcolor="black" TEXT="#FFFFFF">
<center>
<h2>Exsensus Centre de Controle Android</h2>
<form method="post" action="verif.php">
N°SMS : <input type="text" name="number" size="12">
<input type="submit" value="OK"></form>
<form method="post" action="gps.php">
Find My Precious: <select name="gps">
<option value=""> ----- Choisir ----- </option>
<option value="ON"> ON </option>
<option value="OFF"> OFF </option>
</select>
<input type="submit" value="OK"></form>
<form method="post" action="ring.php">
Ring My Precious: <select name="ring">
<option value=""> ----- Choisir ----- </option>
<option value="ON"> ON </option>
<option value="OFF"> OFF </option>
</select>
<input type="submit" value="OK"></form>
</center>
</body>
</html>
U have ur interface now arguments :
gps.php
<?php
// get the "message" variable from the post request
// this is the data coming from the Android app
$message=$_POST["gps"];
// specify the file where we will save the contents of the variable message
$filename="gps.ini";
// write (append) the data to the file
file_put_contents($filename,$message);
// load the contents of the file to a variable
$androidmessages=file_get_contents($filename);
// display the contents of the variable (which has the contents of the file)
echo $androidmessages;
?>
ring.php
<?php
// get the "message" variable from the post request
// this is the data coming from the Android app
$message=$_POST["ring"];
// specify the file where we will save the contents of the variable message
$filename="ring.ini";
// write (append) the data to the file
file_put_contents($filename,$message);
// load the contents of the file to a variable
$androidmessages=file_get_contents($filename);
// display the contents of the variable (which has the contents of the file)
echo $androidmessages;
?>
gps.ini, ring.ini & sms.ini :
OFF
Run a 16bits DOS software into a 64bits Windows OS

To avoid memory leak :
1 - Download DosBox : http://www.dosbox.com/download.php?main=12 - Edit dosbox.conf to mount ur locadrive:
File : C:\Users\%user%\AppData\Local\DOSBox\dosbox-x.xx.conf
Go to end of this file at [Autoexec]
Add : mount c c:\
3 - Close & open Dosbox
4 - Voilà !
Else u can use QBASIC for 64bits : http://www.qb64.net/
page 1 sur 2 suivante


Home Made Little tiny cnc with two CD drive & arduino!
Robot Memo


et S / On boot press 