• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 287
  • Last Modified:

Do i need to add something extra in powershell code if AD tasks are involved ?

Hello,
I have a code that involves AD tasks.
The code needs to be part of a schedule task

Do i need to add anything extra at the top of the code ?

Thanks,
0
namerg
Asked:
namerg
1 Solution
 
Matthew EnglandCommented:
Without knowing anything about the actual code being run, and version of powershell, it's hard to say what you need.

You can run Get-Command to see what Functions and Cmdlets are available on the system. If your code contains any which are not listed, then you likly need to add a an additional module.

Please review the following article. This goes over the pre-requisites for using the Active Directory Module for PowerShell.
Active Directory Administration with Windows PowerShell

If you're Active Directory environment meets the pre-requisites, then you can add the following to your code to load the AD Module.
PS> Import-Module ActiveDirectory

Open in new window

0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now