Solved

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

Posted on 2013-06-21
1
279 Views
Last Modified: 2013-06-21
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
Comment
Question by:namerg
1 Comment
 
LVL 7

Accepted Solution

by:
Matthew England earned 500 total points
ID: 39267116
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Windows Server Update Service (WSUS) is free for everyone, but it lacks of some desirable features like send an e-mail to the administrator with the status of all computers on the WSUS server. This article is based on my PowerShell script …
This article will help you understand what HashTables are and how to use them in PowerShell.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now