Powershell - CMDLET ‘Start-ADSyncSyncCycle’ is not recognized on DC with AD Connect

Tim 66 Reputation points
2022-09-14T10:45:33.387+00:00

Hi!

I'm running into a strange problem.
We are running a DC with a few users as Domain Admins.
All of these admins can login on the same server which is running AD-Connect and are member of the same groups.

There is one admin that cannot perform a Start-ADSyncCyle -policytype Delta.
Before running the command he need to start Powershell as an admin and run the CMDlets:
Set-ExecutionPolicy RemoteSigned
Import-Module -Name "C:\Program Files\Microsoft Azure AD Sync\Bin\ADSync" -Verbose

After this, he can run Start-ADSyncCyle -policytype Delta, but after closing Powershell he needs to do the same thing over and over again.

Is there some way I can make sure the module is being loaded into Powershell by default for this admin?
The other admins do not have this problem and can run the ADSyncCycle command without any issues.

Best regards,
Tim

Windows for business Windows Server User experience PowerShell
0 comments No comments
{count} votes

Accepted answer
  1. JimmySalian-2011 42,486 Reputation points
    2022-09-14T10:54:06.43+00:00

    Hi,

    I think the currect user might have execution policy set, can you confirm with the working admin and with the affected admin the execution policy by this command ?

    Get-ExecutionPolicy -List  
      
    

    If the execution policy is set to RemoteSigned or AllSigned you will need to set it to undefined or same as the other admins.

    Set-ExecutionPolicy -ExecutionPolicy Undefined -Scope CurrentUser  
    Get-ExecutionPolicy -List  
      
    Scope ExecutionPolicy  
            ----- ---------------  
    MachinePolicy       Undefined  
       UserPolicy       Undefined  
          Process       Undefined  
      CurrentUser       Undefined  
     LocalMachine    RemoteSigned  
    

    ==
    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Tim 66 Reputation points
    2022-09-14T11:15:03.863+00:00

    Hi Jimmy,

    Thank you for the input!
    We've just checked it and the settings are exactly the same.

    Best regards,
    Tim


  2. Tim 66 Reputation points
    2022-09-14T11:28:53.117+00:00

    We just deleted his profile on the server and after he logged in he is able to use the CMDlets.
    We broke some shortcuts but it seems to work. Thank you!

    Best regards,
    Tinm


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.