Issues running on-prem AD Powershell module from an Azure AD joined device.

net1994 131 Reputation points
2021-06-07T20:14:27.427+00:00

Hello All - We have a Pc that is Azure AD joined (via Autopilot). It is on a regular internet connection. When running the AD powershell module (as an admin) as soon as I open the module it gives me an error: Error initializing default drive: 'Unable to find a default server with Active Directory Web Services running.' Basically the PC can't find/contact a domain controller. Odd as I can use ADUC console just fine connected to my domain.

This must be an Azure AD device issue as our on-prem domain joined PCs can run these commands fine. VPN has been ruled out as the possible cause. Any thoughts on what the issue could be?

Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,738 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,580 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,544 questions
{count} vote

3 answers

Sort by: Most helpful
  1. Nick Hogarth 3,436 Reputation points
    2021-06-07T22:14:31.557+00:00

    So you are connected to the VPN when you try? Which account are you logged into the Azure AD Joined device with, is it an account that has been synced from on-prem AD to Azure AD by Azure AD Connect? And are you logged in using a password or Windows Hello for Business?

    1 person found this answer helpful.

  2. Jason Sandys 31,311 Reputation points Microsoft Employee
    2021-06-08T14:24:13.78+00:00

    My guess here is that this is a limitation in PowerShell remoting as using PowerShell doesn't connect or operate the same as using the GUI tools.

    Have you tried launching PowerShell using runas and the netonly switch and then trying to connect (I don't know if that'll help of not, but the results may yield more information to go off of)?

    0 comments No comments

  3. net1994 131 Reputation points
    2021-06-12T19:04:24.483+00:00

    One of our AD admins (not me) told me the reason for the error was that our internal domain DCs don't have AD Web Services running for a variety of good reasons. At this time, it's not an issue for all users, just an inconvenience for me. I didn't mention the person with the issue was me on my own new work laptop that was Azure AD joined via AutoPilot. There may be a workaround without AD Web Services running, perhaps? The powershell script I had to run was a one-off and not regularly used. I still have many options (use an older domain joined PC via VPN or RDP or a citrix session). We'll have to still figure out this long term for other IT folks. I am literally the first person in IT that has had this issue.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.