Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Synchronize a new Active Directory domain with an existing Office 365 tenant
Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

840 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