Hi all. I’m fairly new to Powershell scripting, and became stumped on this task based on experience & research. Any help would be greatly appreciated! Please see below.
Objective: Output the results of Name, OperatingSystem, OperatingSystemVersion, lastlogondate to an event log. Currently and reasonably, it’s only outputting the message “This is a test” below in the event log. Any suggestions of how to output the results of the script itself to the event log it generates?
cd c:\scripts Get-ADComputer -Filter * -Property * | Select-Object -Property Name,OperatingSystem,OperatingSystemVersion,lastlogondate Write-EventLog -LogName Application -EventID 3000 -EntryType Information -Source ‘AD PC OS Information’ -Message ‘This is a test’