Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Delete and import servers
#1
I'm trying to delete and import servers. I can delete it by hand, and import it with a CSV file, but i like to do it with powershell.

I can connect to the environment.

$workingdir = "c:\Program Files (x86)\ASG-Remote Desktop 2018\"

Set-Location $workingdir
[Environment]::CurrentDirectory = Get-Location -PSProvider FileSystem

$path = $workingdir + "ASGRD-PSAPI.dll"

Add-Type -path $path
[reflection.assembly]::LoadFrom($path) | Import-Module

Connect-RDEnvironment -Environment 'ASGRD' -PassThrough

I can get the guid from the directorie i like to delete
Get-RDBaseItemId -ItemPath "Connections\WSUS\24-7\1:00"

But when i remove this directory it does nothing no error but als no deleting from the directory
Remove-RDBaseItem -ItemId 7c0c6e13-1b01-441d-9b6f-3de26b3728f5

Can someone tell me how i can remove all the directories after "24-7", "KA", "OTA" and PAT. If it is possible with a example. The direcories are not empty.

The second question is how can i bulkimport servers with Powershell, i have a CSV file.


Attached Files Thumbnail(s)
   
Reply


Messages In This Thread
Delete and import servers - by hvdben - 02-05-2018, 08:46 AM
RE: Delete and import servers - by DevOma - 02-05-2018, 10:36 AM
RE: Delete and import servers - by hvdben - 02-05-2018, 01:40 PM
RE: Delete and import servers - by DevOma - 02-05-2018, 01:43 PM
RE: Delete and import servers - by hvdben - 02-05-2018, 03:36 PM
RE: Delete and import servers - by DevOma - 02-05-2018, 03:46 PM
RE: Delete and import servers - by hvdben - 03-05-2018, 09:15 AM



Users browsing this thread: 1 Guest(s)