question

Shanewalford-7917 avatar image
Shanewalford-7917 asked ·

Query Azure AD DS with PowerShell

Hi,

Can you query Azure AD DS from PowerShell on your local machine like you can Azure AD? Using CLI or Powershell.

Thanks
Shane

azure-ad-domain-services
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

msrini-MSFT avatar image
msrini-MSFT answered ·

Hi,

You will not be able to use PowerShell or CLI to query Azure AD DS unlike Azure AD. You need to have access to any VM which is domain joined to Azure AD DS and you can perform AD commands to perform your query.


2 comments Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,


Thanks for the quick response.


OK, so we have automated the removal of some VMs in Azure DevOps when they are no longer needed. How would you go about automating the removal of the VM from Azure AD DS? or would this need to be a manual step?


Thanks Shane


0 Votes 0 · ·
msrini-MSFT avatar image msrini-MSFT Shanewalford-7917 ·

You need to come up with a logic to run a script in the VM which is joined to AD DS from DevOps. You need to use RAST tool to delete the computer object using a PS command which needs to be executed from the VM which is domain joined

0 Votes 0 · ·