(or use Command Prompt and run "services.msc" to bring up Services control panel)
1: Stop Windows Update Service.
2: Rename/Delete "SoftwareDistribution" folder.
(Full path: C:\Windows\SoftwareDistribution\)
3: Start Windows Update Service.
1: Stop Windows Update Service.
2: Rename/Delete "SoftwareDistribution" folder.
(Full path: C:\Windows\SoftwareDistribution\)
3: Start Windows Update Service.
$obj = new-object -com wscript.shell
$obj.SendKeys([char]173)
$obj = new-object -com wscript.shell
$obj.SendKeys([char]174)
$obj = new-object -com wscript.shell
$obj.SendKeys([char]175)
Function Set-Speaker($Volume){ $ws = new-object -com wscript.shell;1..50 | % { $ws.SendKeys([char]174)};1..$Volume | % { $ws.SendKeys([char]175) } }
Set-Speaker(25)
$domainAdminCred = Credential
$localAdminCred = Credential
$ScriptBlock = {
param($domainAdminCred, $computer)
$domain = "Domain"
Write-Host "[processing '$computer' ...]"
Add-Computer -DomainName $domain -Credential $domainAdminCred -OUPath "OU=group1,DC=testing,DC=com" -Restart -Force
}
$IP = "192.168.1.101"
$computer = "PC-01"
Invoke-Command $IP -ScriptBlock $ScriptBlock -ArgumentList $domainAdminCred, $computer -Credential $localAdminCred
$IP = "192.168.1.102"
$computer = "PC-02"
Invoke-Command $IP -ScriptBlock $ScriptBlock -ArgumentList $domainAdminCred, $computer -Credential $localAdminCred
netsh dhcp show server
1. Use Command Prompt and run "secpol.msc"
2. Click on "Network List Manager Policies"
3. Double-click on your network
4. Click on "Tab Network Location"
5. Set "Location Type" to "Private" (or "Public")
$sc = {
param($IP)
$wmi = Get-WmiObject win32_networkadapterconfiguration -filter "ipenabled ='true'";
$wmi.EnableStatic($IP, "255.255.255.0");
$wmi.SetGateways("192.168.1.1", 1);
$wmi.SetDNSServerSearchOrder(@("192.168.1.1","8.8.8.8"))
}
$IP = "192.168.1.101"
$job = Invoke-Command 192.168.1.121 -ScriptBlock $sc -ArgumentList $IP -AsJob -Credential $cred
Wait-Job $job -Timeout 20
$IP = "192.168.1.102"
$job = Invoke-Command 192.168.1.122 -ScriptBlock $sc -ArgumentList $IP -AsJob -Credential $cred
Wait-Job $job -Timeout 20
$sc = {
$wmi = Get-WmiObject win32_networkadapterconfiguration -filter "ipenabled ='true'";
$wmi.EnableDHCP();
$wmi.SetDNSServerSearchOrder();
}
$job = Invoke-Command 192.168.1.101 -ScriptBlock $sc -AsJob -Credential $cred
Wait-Job $job -Timeout 20
$job = Invoke-Command 192.168.1.102 -ScriptBlock $sc -AsJob -Credential $cred
Wait-Job $job -Timeout 20
# Loop through the server list
Get-Content -Path "C:\Scripts\Computers.txt" | %{
# Define what each job does
$ScriptBlock = {
param($server)
Write-Host "[processing '$server' inside the job]"
$app = Get-WmiObject -Class Win32_Product -computer $server -Filter "Name = 'Java 7 Update 60'"
$app.Uninstall()
Start-Sleep 60
}
Write-Host "processing $_..."
# Execute the jobs in parallel
Start-Job $ScriptBlock -ArgumentList $_
}
Get-Job
While (Get-Job -State "Running")
{
Start-Sleep 10
}
Get-Job | Receive-Job
$pc = "PC-01"
$domain = "Domain"
$user = "Administrator"
$pass = cat C:\securestring.txt | convertto-securestring
$username = "$domain\$user"
$computer = "NewPCName"
$credential = New-Object System.Management.Automation.PSCredential($username,$pass)
Add-Computer -ComputerName $pc -DomainName $domain -newname $computer -OUPath "OU=group1,DC=testing,DC=com" -Restart -Force -Credential $credential
EXIT
$pc = "PCName"
$user = "Administrator"
$pass = cat C:\securestring.txt | convertto-securestring
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist "$pc\$user",$pass
$domain = "Domain"
$user2 = "Administrator"
$pass2 = cat C:\securestring2.txt | convertto-securestring
$domcred = new-object -typename System.Management.Automation.PSCredential -argumentlist "$domain\$user2",$pass2
Remove-Computer -Computer $pc -UnjoinDomainCredential $domcred -LocalCredential $cred -Workgroup workgroup -PassThru -Force -restart
$FilePath = "C:"
Write-Host "Enter login as domain\id:"
Read-Host | Out-File $FilePath\id.txt
Write-Host "Enter user password:"
Read-Host -AsSecureString | ConvertFrom-SecureString | Out-File $FilePath\securestring.txt
icacls C:\Users\Public\Desktop\Share /grant Everyone:(OI)(CI)FManage in PowerShell:
icacls C:\Users\Public\Desktop\Share /grant "Everyone:`(OI`)`(CI`)F"
wmic:root\cli>
product get name
product where name="Java 7 Update 51" call uninstall
Enter "Y" to continute the uninstallation process
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -clientopts -setvnclegacy -vnclegacy yes -clientopts -setvncpw -vncpw VNCPASSWORD -restart -agent -privs -all
$computerName = Get-WmiObject Win32_ComputerSystem
$name = "New Computer Name"
$computername.rename("$name")
curl -O http://rudix.googlecode.com/files/wget-1.12-0.dmg
hdiutil mount wget-1.12-0.dmg
sudo installer -package /Volumes/wget.pkg/wget.pkg -target "/Volumes/Macintosh HD"
hdiutil unmount "/Volumes/wget.pkg/"
Enable-PSRemoting -Force
Set-Item wsman:\localhost\client\trustedhosts *
Restart-Service WinRM
nvram wifiaddr=XX:XX:XX:XX:XX
nvram -d wifiaddr
reboot