Topic
Links
Learn Powershell Microsoft Documentation
Run a command under other credentials
like 'System'

Powershell GITHUB show test

Showing powershell snippets from github
#
# example: get information from schedueld tasks
#
$OutCSV = [System.IO.FileInfo]"c:\temp\tasks_$env:computername.csv"
New-Item $OutCSV.Directory -ItemType Directory -ea 0
$TaskPath = "\*"
Get-ScheduledTask -TaskPath $TaskPath |
ForEach-Object { [pscustomobject]@{
Name = $_.TaskName
Path = $_.TaskPath
LastResult = $(($_ | Get-ScheduledTaskInfo).LastTaskResult)
NextRun = $(($_ | Get-ScheduledTaskInfo).NextRunTime)
Status = $_.State
Command = $_.Actions.execute
Arguments = $_.Actions.Arguments }
} | Out-file $OutCSV
get-content $outcsv

About IT-Pro.nl

IT-PRO.NL Build on Vanjaro, a Digital Experience Platform (DXP) built on DNN - the leading open source web content management platform (CMS) in the Microsoft ecosystem.

Contact

  • Almere, The Netherlands
  • not public ...

Follow IT-Pro.nl

© Copyright 1998 by Digital Funwork