Link to home
Start Free TrialLog in
Avatar of Andrew N. Kowtalo
Andrew N. Kowtalo

asked on

Powershell Script to Show current VBS Script in place running alongside Windows Task Manager

Gents by chance does anyone have any free powershell scripts they use that I can use to query several servers we use to tell me if

1.) The VBS Script I have in place is ran daily and completed.
2.) To get a list of scheduled tasks on each server.
3.) Get the version number from the current version of application we have running on each server.

I am sure there are scripts already out there I would like to just get the script and be shown where I can make the necessary changes to reflect my current setup.

Thank you
Avatar of footech
footech
Flag of United States of America image

That seems like rather specialized requirements. Rather than trying to find a script which does all that, I would suggest something like PDQ Inventory.  It pulls info like scheduled tasks, installed software, etc., and you can make a custom report of just the info you want.
Avatar of Andrew N. Kowtalo
Andrew N. Kowtalo

ASKER

Can you direct me to this? Is it free? How is the documentation?
Doesn't look like its free.   
Yes, they have a free offering - https://www.pdq.com/pdq-inventory/
They have lot's of documentation and videos.
@footech

Thank you will free versiondo what I need and mentioned in my post?  
Get-ScheduledTask cant I just run this from powershell and put in the remote machine name to show me what tasks there are?  If so what is the line?
schtasks /query /s \\servername works just fine
schtasks /query /tn taskname \\servername errors out

what am I missing?
schtasks /query /tn RotateGPTLog \\servername can someone show me the correct line or with get scheduled tasks also add a condition to export the results to a notepad file?
It should, but I can't answer definitively.

As for Get-ScheduledTask, you could run something like below.
$session = New-CimSession -ComputerName "comp1"
Get-ScheduledTask -CimSession $session


But that's not all you asked for in your original question, so I'll stop there with the PowerShell.
$session = New-CimSession -ComputerName "comp1" Get-ScheduledTask -CimSession $session 

Where would I change the computer name and only display the task I want to see?
See the -computername parameter?
Get-ScheduledTask has a -TaskName parameter.
PS C:\Users\akowtalo> $session = New-CimSession -md1001 "comp1" Get-ScheduledTask -CimSession $session
New-CimSession : A parameter cannot be found that matches parameter name 'md1001'.
At line:1 char:27
+ $session = New-CimSession -md1001 "comp1" Get-ScheduledTask -CimSessi ...
+                           ~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [New-CimSession], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.Management.Infrastructure.CimCmdlets.NewCimSessionComma
   nd

PS C:\Users\akowtalo>
You don't change the name of the parameter, you change the info that is supplied to the parameter.
$session = New-CimSession -ComputerName "md1001"

I think it's a better idea to use something like PDQ Inventory.  Otherwise I think you would need to have a complete script custom-written for you and your environment.
No I am not familiar with powershell that is why I am asking for help here.  Thank you for pointing that out.  Have a nice day.
ASKER CERTIFIED SOLUTION
Avatar of Andrew N. Kowtalo
Andrew N. Kowtalo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial