Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

import-module active* not working

$
0
0

Hi All,

I have a script which adds a machine to domain, move it to particular Organization Unit and add the machine to Active Directory Group.

i am trying to import the active directory module after installing Active Directory Domain Services role in Windows 2012 machine, also started the Active Directory Web services.

But importing the module is giving WARNING as:

WARNING:Error initializing default drive: 'Unable to contact the server. This may be because this server does not exist , it is currently down , or it does not have the Active Directory Web Services running'.

The strange thing is: When i again import the module after this warning, it executes successfully.

Then i have to add the machine to a AD Group, which is also not working and giving error as:

Add-ADGroupMember : Unable to contact the server. This may be because the server does not exist, it is currently down, or it does not have Active Directory Web Services running.

At line1: char:1

+Add-ADGroupMember -id GroupName -Members "CN=$name,OU=POC,DN=domainame,DN=com"

 +CategoryInfo: ResourceUnavailable:<GroupName:ADGroup> [Add-ADGroupMember],ADServerDownException

 +FullyQualifiedErrorId :ActiveDirectoryServer:0,Microsoft.ActiveDirectory.Management.Commands.AddADGroupMember

I also tried other AD commands, no commands are working 
and are giving the same error.
Am i missing something, Please guide, stuck at this issue.SadConfused
Thanks in advance!

Viewing all articles
Browse latest Browse all 6937

Trending Articles