Last active
April 24, 2017 19:05
-
-
Save Christwiest/127938c8adb999a814a348c87c366e2b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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 -RandomDelay 00:00:30 | |
Register-ScheduledTask -TaskName "App-V Full sync" -action $Action -Trigger $Trigger -RunLevel Highest -User "$user" -Password "$password" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment