How do I import a module for script use?

I have a script that uses the AD module for some operations. Here is the code:
#04/24/2014
#UsAer Logger
#Author: Alexander Bazzi
#Property of AerSale, Inc
Import-Module ActiveDirectory
$username=$env:username
$computerName=$env:computername
$userProperties = Get-ADUser $username
$departmentOU = ($userProperties.DistinguishedName -split ',OU=')[1]
$officeOU=($userProperties.DistinguishedName -split ',OU=')[2]
$pathOutUser = "C:\Scripts\UsAer_Logger\Output\$officeOU\$departmentOU.txt"
if(Test-Path $pathOutUser)
$computerName >> $pathOutUser
else {
New-Item $pathOutUser
$computerName >> $pathOutUser
When I try to run it on PowerShell ISE, I get the following exception: 
Import-Module : The following error occurred while loading the extended type da
ta file: 
Microsoft.PowerShell, C:\Windows\system32\WindowsPowerShell\v1.0\Modules\Active
Directory\ActiveDirectory.Types.ps1xml : File skipped because it was already pr
esent from "Microsoft.PowerShell".
Microsoft.PowerShell, C:\Windows\system32\WindowsPowerShell\v1.0\Modules\Active
Directory\ActiveDirectory.Types.ps1xml : File skipped because it was already pr
esent from "Microsoft.PowerShell".
Microsoft.PowerShell, C:\Windows\system32\WindowsPowerShell\v1.0\Modules\Active
Directory\ActiveDirectory.Types.ps1xml : File skipped because it was already pr
esent from "Microsoft.PowerShell".
Microsoft.PowerShell, C:\Windows\system32\WindowsPowerShell\v1.0\Modules\Active
Directory\ActiveDirectory.Types.ps1xml : File skipped because it was already pr
esent from "Microsoft.PowerShell".
Microsoft.PowerShell, C:\Windows\system32\WindowsPowerShell\v1.0\Modules\Active
Directory\ActiveDirectory.Types.ps1xml : File skipped because it was already pr
esent from "Microsoft.PowerShell".
I tried running it without the Import-Module cmdlt, but it didn't recognize the Get-ADUser command. If you could shed some light on this, I'd really appreciate it!
Many thanks in advance.
Best,
Alex

You have two different copies of Active Directory module installed.
Get-Module -list Act*
See if there is a second version.  It is also possible that you are loading something in your profile that is loading those components.  Try start PowerShell with the -NoProfile switch then import AD.  If that works then inspect your profiles
- all of them.,
¯\_(ツ)_/¯

Similar Messages

  • MP3:  How large can import file be for 4 GB Nano?

    I am having trouble importing one particular MP3 file, 74,000 kb, into my my 4GB, which is only filled to 1.3 GB. Is the file too big? It's an audio book.

    The thread title "How large can import file be for 4 GB Nano?" is something of a give-away, no?

  • We are having old home movies put on DVD's. How do we import them to MacBook Pro using Snow Leopard and iMovie 8.0.6.  Can watch the video, but can't get it to import.

    We are having old home movies put on DVD's. How do we import them to MacBook pro using Snow Leopard and iMovie 8.0.6?  Can watch the movies on the laptop, but they will not import.

    We took 3 video cassette 8mm that were recorded in the early 90's to a place that burned the videos onto 3 DVDs.  When inserted to our Mac, the DVD player comes on to play the DVD. Opened Quicktime, but can find no way to import. Went to File>Open File>Sony_DVD_Recorder_Volume. Clicked on Sony_DVD-Recorder_Volume and it shows a file named VIDEO_TS.  Clicked on that and 6 files showed VIDEO_TS.BUP,   VTS_01-0.BUP,   VTS_01_0.IFO,  VTS-01_1.VOB,   VTS_01_2.VOB, VTS_01_3.VOB.  Where is DVDxDV?

  • How to compile your flex application for Iphone Using Adobe Flash CS5?

    How to compile your flex application for Iphone Using Adobe Flash CS5?

    I'm so sorry, I'm not really familiar with the codes.

  • How to findout the Function module for a particular object

    Hello friends,
       Related to my thread, there was one thread in the forum,to find out the function module for a particular object.I tried the solution provided my our experts but couldn't got the results.Thats why i am putting this thread again.
      I want to find out the function modules used for the particular object, i.e. Production order.
       solution i tried is, first go to T.C SE37, then in function module field put the object name like Production order and enter, than it will show another screen, there also put object name in function module field and than press enter, it will show all the function modules available for that object.
        So could you guys help me out to find out where i am wrong in the process of finding out the function module for a particular object.
                           Plz don't bother abt the point.Helpful answers will definitely get awarded.
                                Thanking you guys for your valuable support till now and hoping to get in future too.

    Dear
    When the problem is solved please give points too. Otherwise why people will help others, give time and share their valuable knowledge. This will build up self confidence.
    If not solved and closing, then mention the difficulties what u exactly looking for. Simpy closing is not enough because who ever is providing solution will not able to know the real problem.
    How to give points I believe u already know that and need not explain.
    I had seen many times this problem with others too. Even if the problem is totally resolved they give 2 in stead of 10.
    Edited by: BNR on Sep 21, 2008 6:10 PM

  • How to create ENQUEUE function module for s567 table

    Hi Experts,
    Anyone Plz tell the steps how to create a ENQUEUE function module for the table s567.
    Its somewht urgent, plz help me.
    <REMOVED BY MODERATOR>
    Mohana
    Edited by: Alvaro Tejada Galindo on Mar 10, 2008 4:21 PM

    Hi,
    You can create a lock on a object of SAP thorugh transaction SE11 and enter any meaningful name start with EZ Example EZTEST_LOCK.
    Use: you can see in almost all transaction when you are open an object in Change mode SAP could not allow to any other user to open the same object in change mode.
    Example: in HR when we are enter a personal number in master data maintainance screen SAP can't allow to any other user to use same personal number for changes.
    Technicaly:
    When you create a lock object System automatically creat two function module.
    1. ENQUEUE_<Lockobject name>. to insert the object in a queue.
    2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.
    You have to use these function module in your program.
    Hope this will give a basic idea.
    Regards
    Sudheer

  • How to find the function module for standard tables.

    Hi
    Could any one please tell me how to find the standard function module to update the standard tables
    Thanks & Regards
    Sowmya

    Hi sowmya,
    To find the function modules for standard tables you go for a where used list of that particular table and check only function module interfaces checkbox...
    and more over you can go for DB_UPDATE_TABLE will be the function module for updating database table..
    Hope this information would help you
    Regards
    Narin Nandivada

  • How to find standard function modules for IDOCs

    Hi,
    Can anyone tell me is there any way to find the standard function module for IDOC. I have checked BD60 but it's not available. For example  Idoc type WPUBON01 and I need to know the function module. Can anyone tell me the way out.
    Secondly, if anyone can provide me the code to map the file fields and idoc segements.
    Regards

    Use WE82 to find message type associated with Idoc type.
    Then use this message type as a search string to find the FM.
    The associated FMs are.
    POSED_FILL_OVERVIEW_ENT_WPUBON
    POSED_INIT_DATA_WPUBON       
    POSED_LOCK_DATA_WPUBON       
    POSED_OVERVIEW_ASSIGN_WPUBON 
    POSED_READ_DATA_FROM_DB_WPUBON
    POSED_READ_TR_DATA_WPUBON    
    POSED_SAVE_DATA_WPUBON       
    POSED_SEARCH_STRING_WPUBON   
    POSED_STORE_DATA_WPUBON      
    POSED_UNLOCK_DATA_WPUBON     
    POSED_UPDATE_DATA_WPUBON     
    POSED_UPDATE_TR_DATA_WPUBON  
    Thanks,
    Utsah Garg.

  • How to write a kernel module for Solaris

    Hi
    I would like to know where I can find information about writing a kernel module for Solaris. Is there a pdf developers reference?

    http://docs.sun.com
    Search "writing device drivers".Even if I don't intend writing a device driver?

  • How to setup the cluster environment for BPM using weblogic

    want to setup the cluster environment for BPM using weblogic....
    i have installed the oracle weblogic server 10gr3 and oracle BPM enterprise for weblogic 10gR3
    i have used the Admin tools from the "oracle BPM enterprise for weblogic" to setup the configuration and create the weblogic domain servers.
    i can launch the process administrator and import the project exp file to domain server.
    but what should i do to setup cluster environment using weblogic?
    what i want to do is :
    setup one admin machine..
    setup two product machine..
    enable the cluster so the admin machine can monitor the status of the product machine..
    thanks a lot ...

    The install guide at http://download-llnw.oracle.com/docs/cd/E13154_01/bpm/docs65/config_guide/index.html gives a reasonable amount of info on how to do this.
    Personally I have not used the OBPM option to configure WebLogic instead I've used the information in the above install guide to create the weblogic domain in advance of configuring OBPM.
    Once you've setup WebLogic configure OBPM using the values I mention in the following thread: How to set the JMX Engine parameter in Process Administation?
    Let me know any specific config questions and I'll do my best to answer them for you.
    Thanks,
    Mike

  • How do I restore the settings for apps using Time Machine?

    I believe there are problems with items within the Library Folder inside the System Folder.  For example, there are two "Frameworks" Folders, but one has "(from old Mac)" after its name.  I dare not try to remove or even move either.
    Back in the day of OS 9, you could modify something, then search for it by "Last Modified" Date, and find where Apple has hidden itscontents.  It's not so easy in OS X.  I've had some success using Pondini's Time Machine FAQ's, though.  Here is how I got to this problem:
    Our family MacBook died.  After getting a repair estimate of $500 to $700 "if it's the Logic Board," we decided to replace it.  We purchased a MacBook Pro running Lion.  (Later, we brought it to an Apple Store and were quoted $435 in house or $280, but they would have to send it out.  Incredible repair: Logic Board, Top & Bottom Case, Super Drive, Battery, all for $280.  No wonder they're #1).  I pulled the Hard Dive out, erased it, and installed an older operating system, but during the repair they installed 10.6.
    Restored the MBP from the TM backup of the MacBook. OK
    The Macbook is repaired and the store showed me how to restore the data from the TM backup.
    Restart and the passwords do not work due to restoring a 10.6 machine from a 10.7 backup.
    Tech support guides me through resetting an admin password using the password utility on the install DVD.
    changed the other passwords inside of Accounts in System Preferences.  Then changed the password or the other Admin.
    Restart, get a circle with a line through it.
    Tech support guides me through fixing this.
    Restart, half my Apps do not work.
    Tech support says to re-install 10.6.
    I did but I thought it would erase and install but it just re-installed 10.6.
    Most Apps work, except iPhoto.  Mail is OK sending but only receives on one of 3 accounts.
    Is there a fix for iPhoto & Mail?  If not, I would plan to erase and use the finder to drag the user folders from TM to the MacBook.  Can I just drag the Apps too?  How about all of the settings for those Apps?

    If you don't keep a backup, you can't restore your machine to any state except the state in which you received it, brand new, with none of your own stuff on it. That makes a pretty convincing argument for backing up, doesn't it?

  • How to create a multiplayer game for steam using flash/flex?

    Hi guys,
    We've got a multiplayer game ready to go. Currently it is not multiplayer, but we'd like to get it to a stage where it can be played over the steam network by users of steam and owners of steam games.
    We'd like to if anyone could briefly give us a breakdown of how to get out game up on steam and available for multiplayer?
    Does steam host servers, and can we utilise a steam server to transfer data between players or would we have to run our own server?
    Currently were using flash builder to publish via adobe air to a windows desktop exe. Can anyone briefly explain how - once a player has downloaded the game from steam we can connect two players? Does anyone know how to use actionscript 3 to access steam network?
    Anyone have any experience developing multiplayer turn based game for steam using flash /actionscript 3 /adobe air?
    Thanks for your help in advance,
    i

    You would want to use the SteamWorks API, which is available from Steam as a C++ library, but there is most likely an Adobe Native Extension (ANE) that would allow you to use the library in AS3.
    I've never used SteamWorks but it seems to support peer-2-peer matchmaking (in other words, you wouldn't even need your own server, I think.)
    SteamWorks API:
    https://partner.steamgames.com/documentation/api
    Search results for "SteamWorks AIR ANE":
    https://www.google.com/search?q=steamworks+air+ane
    -Aaron

  • HOw do I create a ringtone for iphone5 using the new itunes

    How can I create a ringtone for my iphone 5 using the newest version of itunes. Thanks

    This article takes you through the process
    http://www.simonblog.com/2012/12/01/itunes-11-how-to-create-free-ringtone-and-te xt-tone/

  • "dtutil", how to tell which configuration file for packages using after deployment?

    Hello All, 
    Trying to achieve this feature, 
    Using DOS command to automatic my deployment process--glad I found dtutil. However, it doesnt give you any chance to identify which configuration file to be used by SSIS packages after deployment.
    Deployment Method: file deployment
    Configuration sued: XML file and SQL Table. IN XML file, it tells which DB connection for packages to look up the configuration table.
    Who can share some thoughts on this?
    Derek

    It is NOT about sequence.
    It is about how to point which configuration file to be used by deployed packages as during the "dtutil.exe"
    deployment, you dont have chance to identify which physical location confg files to be used.
    Derek
    That you do only at the time of execution of packages. By default it uses configuration settings created at design time within the package. If you want to override it, you can use \Configfile switch of dtexec for that. You can also set explicit values for
    properties using /SET switch
    http://technet.microsoft.com/en-us/library/ms162810(v=sql.105).aspx
    See this to understand how configs are applied in runtime
    http://technet.microsoft.com/en-us/library/ms141682(v=sql.105).aspx
    and this to understand behaviour difference in ssis 2008 
    http://technet.microsoft.com/en-us/library/bb500430(v=sql.105).aspx
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How can i save my annotations for future use?

    Hi,
    I have several ePub files in iBooks that I annotated, with the highliter as well as the post-it feature.
    Now how can I save those for fututre use? I'm not talking about iTunes sync/restore. I'm talking about removing the book from the iPad and use it back in, say, 4 years, or even pass it to someone else along WITH the highlighted sections.
    In a word: keep the book with the annotations on the side OR keep the book embeding the annotations.
    This is for ePub of course, not purchased in iTunes, but free books or purchsed ePub from external sources (like O'Reilly).
    After playing with DiskAid, I got a copy of the internal annotation database (my iPad is not jailbroken) and was able to see all the notes in it. But any existing tool to actually extract and link those notes to a specific book would be exactly what I would need...
    Possible? Hopefully yes...
    Thanks for any help.
    Steve

    Anyone?

Maybe you are looking for

  • Problem with SLES11-HAE updates!

    What is libopenhpi? Never heard about it and it does not exist on the fs!! cpbn21:~ # rug lu S | Catalog | Bundle | Name | Version | Arch --+-------------------+----------------------------------------------------+---------------------+--------------

  • Adding background to the film

    Dear all, I'm new to Captivate and obviously new to this forum. I've already found answers to some questions I had as a beginner and I hope you, guys, can help me with this one. I have a film that explains how to use software that our company created

  • Shanghai, China?

    I ordered the new V-iPod (30GB) last week (should be here Wednesday)... This is the first time I've ordered from Apple and had the tracking start in Shanghai, China!!

  • Can't install Photoshop (CS3) via Remote Disc

    I was successfully able to install iWork '08 last night via Remote Disc, but I've tried twice to install Photoshop and both times it failed. I was able to get on Acrobat Professional and some of the Shared Components, but after anywhere between 30 mi

  • How to manage itunes with two ipods

    I have two iPods, a 60G photo and a 30G video. I have two macs, one at work, the other at home. My iTunes on the work computer has about 50G of music, and about 15G on my home computer. Until now, I have only synced the big iPod with the work compute