Solved

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

Posted on 2013-06-21
1
281 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
DHCP scope restore question Server 2003 to 2012R2 6 59
How to filter result in PowerShell 10 58
Powershell Interpretation Request 2 11
Yes, Powershell again 5 12
The article will show you how you can maintain a simple logfile of all Startup and Shutdown events on Windows servers and desktops with PowerShell. The script can be easily adapted into doing more like gracefully silencing/updating your monitoring s…
In this previous article (https://oddytee.wordpress.com/2016/05/05/provision-new-office-365-user-and-mailbox-from-exchange-hybrid-via-powershell/), we made basic license assignments to users in O365. When I say basic, the method is the simplest way …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

772 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