locked
Run script using Powershell for AD RRS feed

  • Question

  • Hi

    I have written a basic Powershell script to populate a Group with members of an OU. This works fine when I run it manually but I want to schedule the scripts to run daily.

    If I try and schedule powershell the normal powershell is used, how can I schedule this so the task runs under the Active Directory Module? ie the scripts can run powershell AD commands.

    I have tried placing "import-module Active Directory" as an additional argument within the task properties but this does not seem to be having the desired effect.

    Thanks

    Monday, January 19, 2015 3:08 PM

Answers

  • Include the Import-Module statement at the top of your script.
    • Proposed as answer by jrv Monday, January 19, 2015 3:17 PM
    • Marked as answer by MikeeMiracle Monday, January 19, 2015 4:09 PM
    Monday, January 19, 2015 3:12 PM