PowerShell for Windows Admins:

July, 2011


July 3, 2011  6:52 AM

Computer Report IV: Time server



Posted by: Richard Siddaway
Operating System, PowerShell v2, WMI

The batch file uses

net time /querysntp

which displays the name of the Network Time Protocol (NTP) server currently configured for the local computer or the one specified in ComputerName.

Unfortunately /querysntp  has been deprecated in later versions of...

July 3, 2011  5:17 AM

Computer Report III: Eventlog service



Posted by: Richard Siddaway
PowerShell v2, WMI

The batch file has a separate report for event log service status

wmic service where name="EventLog" get Name, SystemName, StartMode, Status

PowerShell translation

Get-WmiObject -Class Win32_Service -Filter "Name='Eventlog'" | Select Name, SystemName,...


July 3, 2011  5:06 AM

Computer Report: II Service Information



Posted by: Richard Siddaway
Operating System, WMI

 

The batch file retrieves service information using

wmic service where state="Running" get DisplayName, Caption

Direct PowerShell translation is this.

Get-WmiObject -Class Win32_Service -Filter "State='Running'" | Select DisplayName,...


July 1, 2011  1:56 PM

Computer report



Posted by: Richard Siddaway
Hardware, Operating System, PowerShell v2, WMI

A recent post on the powershell.com site asked about running a Windows command (batch) file through PowerShell against remote machines. The batch file was expected to produce a number of files of data in a folder structure based on computer name. This makes it difficult as we could in theory run...