Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $user = Read-Host -Prompt 'Input User name too run the script Example DOMAIN\User'
- $pass = Read-Host -AsSecureString 'Input Password of user to run the script'
- $path = Read-Host -Prompt 'Path to script Example C:\Temp'
- $password = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($pass))
- $Action = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument "$path\Syncing_Staging_App-v_Citrix.ps1"
- $Trigger = New-ScheduledTaskTrigger -AtStartup
- Register-ScheduledTask -TaskName "App-V Full sync" -action $Action -Trigger $Trigger -RunLevel Highest -User "$user" -Password "$password"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement