Link to home
Start Free TrialLog in
Avatar of zozig
zozigFlag for United States of America

asked on

Powershell commands and service accounts

Hi Everyone,

I'm currently attempting to provision mailbox accounts with the use of a powershell command that is running under a windows service with a specific account set to the run the command.  When this command executes from the windows service I recieve the following error:

An Active Directory error 0x80070035 occurred while searching for domain controllers in domain xxx.xxx.xxx: The network path was not found.

The command I'm executing is as follows:

C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\bin\exshell.psc1" -NoLogo -NonInteractive -Command "Enable-Mailbox -Identity 'cn=test user,ou=testou,dc=xxx,dc=xxx,dc=xxx' -Database exchserver1\sg1\db01 -domaincontroller DC1.xxx.xxx ;";

When I log in to this server and execute the same command from the Exchange Management Shell the script runs fine and creates the mailbox.  Unfortunately when it runs from my Windows Service I get the error denoted above.  Does anyone have any insight into what might be going on?  My suspicion is that this is a required permision for the service account that is not set and causing the issue or the invocation of powershell through the command line can't search Active Directory.  

Environment Details
Exchange Server Version: Exchange Server 2007
Operating System: Windows 2003 SP 2
Avatar of Ragu Ramachandran
Ragu Ramachandran
Flag of India image

Can you try testing the same command with ip address instead of the DC name?
Avatar of zozig

ASKER

I tried it by IP and get the same issue
SOLUTION
Avatar of JuusoConnecta
JuusoConnecta
Flag of Sweden image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Glad you got it resolved =], thanks for sharing the solution!