Navigating the drive
Navigating the drive
As the name implies, PowerShell drives mimic the behaviour of drives known from common filesystems. Therefore you can use the commands "Set-Location", "Get-ChildItem", "New-Item" and "Remove-Item" (or their aliases "cd", "dir", "mkdir" or "del" of course) to navigate the tree-like structure of the PowerShell drive, list or view contained objects, create or delete objects etc.
The root node of the created emdb drive contains three "virtual" directories:
- rootDSE
- rootCatalog
- rootExternal
The virtual directory rootDSE and its subdirectories might be of special interest, because it corresponds to the "ORG-Object" of the DSM 2022.2 environment.
Please execute the command
Set-Location rootDSE |
to change into this directory.
Hint: It is recommended using the tabulator key to take advantage of the path-completion feature of PowerShell. This helps avoiding spelling mistakes. The SOAP interface is case sensitive and when using the completion feature you are on the safe side regarding the spelling of directory names etc. |
Now execute the command
Get-ChildItem |
(or its alias "dir") to list the contents of the directory rootDSE. You will find, among others, the well known directories "Managed Users & Computers", "New Users & Computers", but also the directory "Global Software Library".
Change into the Organization Directory by executing the command
cd "Managed Users & Computers" |
and execute the command
dir -Recurse -Filter "SchemaTag=Computer" |
to list all computers contained in the directory "Managed Users & Computers" and its subdirectories.
Hint: Further information about the Filter parameter is available in section Using filters. |
The command
dir -Recurse | Where-Object {$_.SchemaTag -eq "Computer"} |
achieves the same result. Another approach - maybe the most obvious approach in the context of the PowerShell Extensions for Ivanti DSM - is the following command:
Get-EmdbComputer -Recurse |
Now explore the parts of the Organization Directory residing below the "Managed Users & Computers" domain. Try to use the other cmdlets of the PowerShell Extensions for Ivanti DSM, e.g.:
- Get-EmdbGroup
- Get-EmdbOrganizationalUnit
- Get-EmdbDomain
- ...
Execute the command
Get-Help <Name des Cmdlets> |
to read up about the cmdlet parameters. Try to combine the cmdlets provided by the PowerShell Extensions for Ivanti DSM with the standard cmdlets provided by PowerShell itself, e.g. execute the command
Get-EmdbSoftwarePackage -Recurse | Where-Object {$_.SchemaDisplayName -eq "WUS-6-Package" -And $_.ReleaseStatus -eq "Released"} | Measure-Object |
in the context of the Global Software Library to determine how many patch packages have been downloaded and how many of them are been already released. Notice that the execution time of the command depends on the number of patch packages that are already available in your DSM 2022.2 environment.