I will need to remove a software from more than 30 Windows 2003 servers once I confirmed it has the memory leaking bug. To make the job easier, I prefer to use script (as always): $app = Get-WmiObject -Class Win32_Product -ComputerName (Get-Content servers.txt) | Where-Object {$_.Name -match "Software Name"} $app.Uninstall() NOTE: 1) Win32_Product WMI class is … Continue reading PowerShell: Uninstall Software Remotely
Category: Microsoft
PowerShell: Check Service Status
To ensure the Backup Exec Agent service running OK on each cluster nodes. I created a list to include each nodes and named it as CS_servers.txt, then use the following script to get the status of it. Get-WmiObject win32_service -ComputerName (Get-Content CS_servers.txt) -Filter "name='BackupExecAgentAccelerator'" | select __server,name,startmode,state,status The results are like: __SERVER : CS-node-01 name … Continue reading PowerShell: Check Service Status
PowerShell: Find a Specific Event ID
We have a bunch Windows servers having the notorious 333 error issue periodically. To catch this error as soon as possible, I wrote a script and added it into schedule tasks. $Servers = Get-Content servers_list.txt Foreach ($Server in $Servers) { Write-Host -backgroundcolor yellow **************$Server********************* Get-EventLog -ComputerName $Server -LogName System -After (Get-Date).date | Where-Object {$_.EventID -eq … Continue reading PowerShell: Find a Specific Event ID
Batch Script: A Few Used With Psexec
I have been using psexec and batch scripts to do some system management jobs remotely. Here are couple examples of frequently used ones. psexec \\computer_ip_address -u administrator –p ***** –c xxx.bat (xxx.bat can be any batch scripts you created) e.g: psexec \\172.29.16.10 –u administrator –p ******** –c disableFW.bat xxx.bat examples: 1) disableFW.bat: disable the Windows … Continue reading Batch Script: A Few Used With Psexec
PowerShell: Get DHCP Information
To get the information like how many computers are in the domain, how many are not in the domain, how many computers are responsive. I wrote the following script. 1) Create a txt file named dhcp_scope.txt under the Windows folder in the DHCP server, and add the scope into the file. e.g. 172.29.1.0 172.29.2.0 172.29.3.0 … Continue reading PowerShell: Get DHCP Information