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
Tag: PowerShell
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
PowerShell: Find Duplicated ePO GUID
McAfee ePO (ePolicy Orchestrator) client may have duplicated GUID when the computer restore to a previous system status or the computer is a clone of another one. I wrote a script to list the computer names with duplicated GUID, so I can target and process them. Remove-Item machines_draft.txt# copy the ePO server logCopy-Item "\\epo-server-name\c$\Program Files\McAfee\ePolicy … Continue reading PowerShell: Find Duplicated ePO GUID
PowerShell: Compare Text Files And Export Different Entries
I am not a great script writer. But I love using script, as it is simple but very handy Scenario: I got a long list of machines (all.txt) that need to be processed, and part of them have already been processed by a guy. And he send me a list (processed.txt) that he have done. … Continue reading PowerShell: Compare Text Files And Export Different Entries
PowerShell: Remove Remote Registry Keys
I wrote a power shell script to delete the duplicated ePO GUID stored in the Windows registry key. Firstly, I would like to know which machines are responsive. Then I need to find out whether I got the admin permission on the remote machines. Lastly, remove the specified reg keys. #Read the machine name data … Continue reading PowerShell: Remove Remote Registry Keys