02-05-2018, 08:46 AM
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.
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.