Workspace-Guru

ConnectAppVolume

Oct 13th, 2018
4,454
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $AV_Username = "DOMAIN\User"                ## App Volumes Administrator
  2. $AV_Password = 'P@ssw0rd'                   ## App Volumes Administrator password
  3. $AV_server = "appvolume.domain.local"       ## App Volumes Server
  4.  
  5. ### Connect to App Volume Server
  6. write-host -ForegroundColor "yellow"  "connect to $AV_server"
  7. $server = $AV_server
  8. $body = @{
  9.         username = $AV_Username
  10.         password = $AV_Password
  11. }
  12. Invoke-RestMethod -SessionVariable Login -Method Post -Uri "http://$server/cv_api/sessions" -Body $body | Out-Null
  13.  
  14. Set-Variable -Name Login -value $login -Scope global
  15. Set-Variable -Name Server -value $server -Scope global
Advertisement
Add Comment
Please, Sign In to add comment