Get Windows Scripting Host info with PowerShell

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 3 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
Alex_Hoer
Posts: 2
Last visit: Sun Dec 04, 2022 10:57 pm

Get Windows Scripting Host info with PowerShell

Post by Alex_Hoer »

Hello, we want to deactivate the Windows Script Host on all of our VMs in the network. However, since we currently do not know which scripts are still being executed by the WSH and do not want to / cannot check them manually on each server, we need a script which provides the following properties for each system:

Is WSH activated?
Has WSH been running a script recently?
Which script was executed?
When was it carried out?
Unfortunately, I couldn't find anything suitable on the Internet.

Many thanks for the help!
by jvierra » Thu Feb 04, 2021 3:09 am
To do this you would have to enable auditing of the WSH engine (cscript, wscript). The audit records would then be available in the event log.
Go to full post
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Get Windows Scripting Host info with PowerShell

Post by jvierra »

To do this you would have to enable auditing of the WSH engine (cscript, wscript). The audit records would then be available in the event log.
This topic is 3 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked