Powershell Copy User Description from one Domain to another in one Forest

Hi.
I would like to copy the Description field from one domain to another domain in the same forest.
First I would like to get the following data from source domain
- SamAccountName
- Description
- Office
- Job Title
- Department
- Manager
I would like to get these informations to a txt-file. That I can manage myself, I think.
These values shoud then be set on the destination domain - and here my powershell skills are not suffecient. How do I add these values from txt-file to existing users? (if some users aren't there, the script should continue)....
I can Get-AdUser -Identity xxx -Server sourcedomain and Get-AdUser -Identity xxx -Server destinationdomain from the same powershell windows.
Regards
Carsten
Carsten

Hi. Thank you very much for helping me out. I tried the above script and added in additional properties.
When I run the script, I only get one line in my csv-file, the Office-field is empty and all items appear on screen instead of output to file.
The script looks as follows:
$ou = [adsi] "LDAP:<Server>"
$searcher = New-Object System.DirectoryServices.DirectorySearcher $ou
$searcher.Filter = 'objectClass=user'
$result = $searcher.FindAll()
foreach($contacts in $result)
 $contact = $contacts.GetDirectoryEntry()
 $contact | Select-Object -Property @{Name="SamAccountName";Expression={$_.SamAccountName}},
           @{Name="Description";Expression={$_.Description}},
           @{Name="Office";Expression={$_.Office}},
           @{Name="Title";Expression={$_.Title}},
           @{Name="Department";Expression={$_.Department}},
           @{Name="Manager";Expression={$_.Manager}}
$contacts | Export-Csv -Path output.csv
Carsten

Similar Messages

  • OBIEE 10g Copy user profile from one Env to another Env

    Hi All,
    I have to copy an user profile from DEV to SIT.
    It has so many components. I have copied the following components from DEV to SIT. but i am getting an access errors. could you please help me find out what am i missing?. I also tried by deleting user1.atr on Target Server.
    web\catalog\DEV_REPO\root\users\user1                -- folder
    web\catalog\DEV_REPO\root\users\user1.atr           --file
    Error:
    Assertion failure: pRoot at line 107 of ./project/webxml/xmldocument.cpp
        Error Details: Error Codes: OQ78YWIW
    Regards,
    Suresh

    How are you friend
    by this time you might have checked this OBIEE - Oracle Business Intelligence 911: OBIEE 10g Error from Dashboard layout

  • How do I copy User Properties from one user to another using Server API

    Portal Version is 10GR3
    I have two Users in the portal and I want to copy all the properties of user1 to user2.
    the IPTProfileManager interface allows me to get all the properties of user 1. Accomplished through the use of
    IPTObjectProperties user1Props = profileManager.GetUserProperties(userId, false);
    IPTQueryResult qr = user1Props.GetPropertyData(PT_PROPIDS.PT_PROPID_OBJECTID |
                   PT_PROPIDS.PT_PROPID_NAME |
                   PT_PROPIDS.PT_PROPID_PROP_VALUE);
    I beleive this is correct...
    We now have all the properties in a Query Result. I'm lost as to how to get these values into user2's profile...
    -Or- is there a easier way????
    Any suggestions?
    Phil Orion
    Orion like the constellation, not the Irish guy.

    Every object in the Server API extends the PTObject, which has function calls GetObjectProperties().
    If you have the PTUser object you have to do the following:
    IPTObjectProperties props = getObjectProperties(); // in your case this should be something like PTUser.GetObjectProperties();
    Object[][] propData = new Object[PT_EDIT_PROPDATA_COLUMNS.PT_EDIT_PROPDATA_INVALID][1];
    propData[PT_EDIT_PROPDATA_COLUMNS.PT_EDIT_PROPDATA_PROPERTYID][0] = new Integer(#PropertyID#);
    propData[PT_EDIT_PROPDATA_COLUMNS.PT_EDIT_PROPDATA_VALUE][0] = "Property Value";
    props.SetPropertyData(propData);
    I don't forget on the end you have to call PTUser.Store() function
    cheers
    Edited by: Pelov on 14.07.2010 12:31

  • How to copy a user account from one Mac to another

    If I have a main user (admin) account on one Mac, and want to copy its Home Folder over to another Mac that already has user accounts on it, what is the best way to do it?
    For example, if I boot the source Mac in Target Disk Mode then connect it to the other Mac, can I just drag and drop from its Users folder into the Users folder on the other Mac? And would that then appear in SysPref/Accounts, complete with names and passwords etc, or is it not that simple?
    (Actually, I just checked by launching Migration Assistant, and it seems to indicate I can use it to copy User Accounts from a different Mac - is this all I need? How would I connect the two Macs for this to work?)

    Slightly confusing, that article - it talks about using Migration Assistant in Lion or Mountain Lion, but in my case both computers have used Snow Leopard. Does it still apply?
    (One other observation - don't you find it confusing the way Apple defines "Target Disk Mode"? It's pretty much always the case that a computer booted in this way becomes the Source computer, while the Target computer is the one it's connected to!!)

  • How to copy discoverer workbooks from one user to another user

    I need to be able to copy all workbooks from one user and save them in a shareable user account. The request is being made by his manager (in preparation for the user's retirement) so I need to do it without the user's knowledge. The manager wants to ensure that all workbooks are copied. For example, can the DBA copy all workbooks of schema JOHNDOE to APPLEX. We are using  Oracle Database 10.2.0.5.0 and Discoverer 10.1.2.3 in the Windows environment.
    Robert

    Robert
    Are these workbooks saved in the database or on a file server somewhere? If its the latter you just need to copy them to another location.
    If they are saved to the database you can export them using the Admin tool but I have a feeling you will only be able to do this if you have access to them: aka they have been shared with you. So here's several ideas:
    1. Grant JOHNDOE and APPLEX access to be an administrator then log on as JOHNDOE in the Admin tool and use File | Export | Selected Objects | Workbooks and export ALL workbooks owned by JOHNDOE. Then you log in as APPLEX and import the workbooks this time taking ownership. Now you can share them with whoever else needs them. You will need to make sure that APPLEX has access to the same business areas as JOHNDOE. When done you can revoke the admin rights of JOHNDOE.
    2. If you don't know JOHNDOE's password you could export the entire EUL to a file. For example if you EUL is owned by a user called EUL_US then create another database user called EUL_US_TEMP and install an empty EUL as a Private EUL, not Public. Then you grant APPLEX permission to be an administrator of this new EUL. Next you log in as APPLEX in the new EUL and import the EUL you exported earlier, this time also taking ownership of all workbooks only if the original owner cannot be found.You'll find that APPLEX has access to ALL workbooks not just those originally owned by JOHNDOE so next you have to work out which ones were originally owned by JOHNDOE. You can do this in SQL by examining the file called EUL5_DOCUMENTS in the original EUL and look for all documents owned by JOHNDOE. Now that you know the names of the documents you log back into the new EUL as APPLEX and export only the workbooks you want to a separate export file. With that done you can log in as APPLEX into the original EUL and import that file this time always taking ownership. Finally you can drop the EUL_US_TEMP schema.
    Hope this helps
    Michael

  • Needed to copy the share from one server to share in another server

    Hi ,
    Needed to copy the data from one share named as xyz in the server 1 to the another share abc in another server 2.
    Share xyz data should be copied to the share abc which has already different data in it .We need to copy all the data from the share xyz to the share abc  without deleting any existing data in the destination share.
    I know that /MIR option will replace the destination same as source
    Can anybody help us in the Robocopy command & switches for this activity?
    Any help is greatly appreciated!
    Thanks & Regards S.Swaminathan Live & let others live!!!

    Hi Mandy,
    Thanks for your reply.
    I have done many robocopy for the share movements from the one server joined in a domain to another server joined in the same domain.In that instances, the destination server will not be having any share of the old server name and just I robocopy the share
    from the old server to the new server after creating a new share .The usual command is as follows:
    "\\server1\oldshare" \\server2\newshare" *.* *.* *.* /ZB /E /COPY:DATO /XJ /R:0 /W:0 /TEE /dcopy:T /NP /log:c:\robocopy.txt
    And after the copy , during the cutover of the standalone DFS pointing to the new share , the domain users in the corresponding access groups (name of the groups based on the old server name) of Full,Modify,Read will be appropriately copied to the respective
    new  groups (name of the groups based on the new server name) of the new share and the access is ensured by the users.
    But in this case , the destination server is already having a share with existing data in it and to be added with the old share data
    My question is shall I use the same command as before by copying all the data to the newly created subfolder inside the existiing destination share through the following command
    "\\server1\oldshare" \\server2\newshare\new sub-folder" *.* *.* *.* /ZB /E /COPY:DATO /XJ /R:0 /W:0 /TEE /dcopy:T /NP /log:c:\robocopy.txt
    You have already mentioned /E without purge options will do.
    Just asking one more time for the safer side
    Thanks & Regards S.Swaminathan Live & let others live!!!

  • How to copy a table from one text frame to another...

    Is there a way to copy a table from one text frame to another? I'm using JavaScript. The following will move a table from one text frame to another, but I need to copy.
    var srcFrame = document.textFrames.item("section-template");
    var dstFrame = document.textFrames.item("test");
    srcFrame.characters[0].move(LocationOptions.before, dstFrame.insertionPoints[0]);
    Thanks,
    Mike-

    Hi Bhupinder,
    According to your description, you want to copy a table with Primary keys from one database to another database.
    As per my understanding, I think the best method is use Transfer SQL Server Objects Task in SQL Server Integration Services. The Transfer SQL Server Objects task transfers one or more types of objects in a SQL Server database between instances of SQL Server.
    Server roles, roles, and users from the specified database can be copied, as well as the permissions for the transferred objects. Indexes, Triggers, Full-text indexes, Primary keys, Foreign keys can also be copied.
    To use the Transfer SQL Server Objects Task, we should create a SQL Server Integration Services Project in SQL Server Data Tools, then drag a Transfer SQL Server Objects Task to Control Flow pane. Specify SourceConnection, SourceDatabase, DestinationConnection
    and DestinationDatabase for the Connection, select the table in the ObjectsToCopy category, then change CopyPrimaryKeys to True and the other corresponding properties in the task.
    References:
    Transfer SQL Server Objects Task
    Transfer SQL Server Objects Task in SSIS 2008 R2 With Example
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Copy user attribute from different user to user currently being edited

    Dear all,
    I'm somehow stuck with a requirement I've to implement.
    I've to copy some user attributes from one user to another. I learned that I should be able to use "getResourceObject" for
    this and I tried to implement this in my user form:
    <Field name='otherUser_actvtGrps'>
    <Display class='Text'>
    <Property name='title' value='otherUser_actvtGrps'/>
    </Display>
    <Default>
    <set name='otheruser'>
    <invoke name='getResourceObject' class='com.waveset.ui.FormUtil'>
    <select>
    <ref>context</ref>
    <ref>:display.session</ref>
    </select>
    <s>SAP_System_A</s> <!-- the resource ID -->
    <s>User</s>
    <s>TemplateUser</s> <!-- this is the AccountID that i need as source -->
    <null/>
    </invoke>
    <ref>otheruser.user.attributes.activityGroups</ref> <!-- this is the attribute from the source user I want to copy/read -->
    </set>
    </Default>
    </Field>
    But this does not return anything..
    Any ideas what I did wrong ?
    Many many thanks for any help/ideas !
    Best regards
    Joerg

    Do you know where to get some docs about the topics you mentioned ?
    1. Your adapter might not to support Resource Objects of type User.ResourceReference manual, the "Resource Object Management" section in each adapter chapter. Also the resource description in XML has the ObjectTypes section, for example, for Active Directory adapters:
      <ObjectTypes>
        <ObjectType name="Group" nameKey="UI_RESOURCE_OBJECT_TYPE_GROUP" icon="group">
          <ObjectClasses operator="AND">
            <ObjectClass name="Group"/>
          </ObjectClasses>
          <ObjectFeatures>
            <ObjectFeature name="create"/>
            <ObjectFeature name="update"/>
            <ObjectFeature name="delete"/>
          </ObjectFeatures>
          <ObjectAttributes idAttr="distinguishedName" displayNameAttr="samAccountName" descriptionAttr="description" objectClassAttr="objectclass">
            <ObjectAttribute name="cn" type="string"/>
            <ObjectAttribute name="sAMAccountName" type="string"/>
    2. You can fetch the complete user view with all resource account information.You will find many examples in IdM XPRESS samples.
    Get user view using LighthouseContext and user accountId
    <invoke name='getView'>
      <invoke name='getLighthouseContext'>
        <ref>WF_CONTEXT</ref>
      </invoke>
      <concat>
        <s>UserViewer:</s>
        <ref>accountId</ref>
      </concat>
      <Map>
      </Map>
    </invoke>Or with WorkflowServices (see BusinessAdministration manual):
    <Action id='0' application='com.waveset.session.WorkflowServices'>
      <Argument name='op' value='getView'/>
      <Argument name='viewId'>
        <concat>
          <s>User:</s>
          <ref>accountId</ref>
        </concat>
      </Argument>
      <Return from='view' to='user'/>
    </Action>
    3. You can fetch resource account info directly using ResourceAdapter API (not too well documented way).Example in Java:
        LighthouseContext ctx = <get context here>;
        // Get resource object
        Resource res = (Resource) ctx.getObject(Type.RESOURCE, <resource name>);
        // Pack resource and user accountId into a ResourceInfo object
        WSUser user = new WSUser();
        ResourceInfo info = new ResourceInfo();
        info.setAccountId(accountId);
        info.setResource(res);
        info.setAttributes(null);
        user.setResourceInfo(new ResourceInfo[] {info});
        // Rertrieve ResourceAdapter object
        ResourceAdapter ra = ResourceOp.findAdapter(res, res.getCache());
        // Get account info into the 'user' object
        WSUser result = ra.getUser(user);
        // Now you can get account status from ResourceInfo ...
        info = result.getResourceInfo(res);
        // ... and account attributes from WSAttributes
        WSAttributes attributes = result.getWSAttributes();
        ...

  • Can I copy my iTunes from one Mac to another to a distant location?

    I have 2 homes one in NYC and the other in upstate NY. I have multiple Macs at both locations all using Snow Leopard and the latest version of iTunes(9). I only have 1 iTunes library I maintain at the upstate location and have to bring my iPod to the NYC location to play my music. Can I not copy my iTunes library to the NYC location using Home Sharing or using some other method? I often forget to bring my iPod and am left without my music.

    Prince Moe wrote:
    Hi
    Since I had a problem with my Mac's drive that suddenly failed (I am able to read ONLY), I replaced the internal HD with my emergency HD that I had backedup a few months before. I would like to know if there's a way to copy my settings from one mac to another? Is there a specific folder for all apps or do I have to find out each and every single file for each app?
    I need the settings for
    System (view, font, color,)
    Finder (view, etc)
    iTunes (that include all library, playlists, etc),
    Firefox (Bookmarks, settings & plug-ins),
    Safari (Bookmarks, settings & plug-ins),
    Address Book (contacts)
    Thuderbird (emails accounts, contacts, passwords, etc)
    Stickies (stickies on the dock - i have info on there unsaved)
    Filezilla (FTP infos)
    Would appreciate.
    Thnx.
    All that info is found in your user/library folder, I just did a 60 machine rollout and copied all those settings from user/library, just be forewarned that if you upgrade software those setting will not take on the machine, for example Adobe CS 3,4 will not usable by CS5.  let us know if you need more help.  Also make sure you copy most of your preferences in the user/library/prefences folder.
    Note: If you are using an identical backup with all apps and user settings, you can just copy all folders from user to your new home folder.  Remember that only if the image or backup is identical to your production OS.

  • How to transfer user settings from one account to another (on the same Mac)

    I'd like to create separate user accounts for "work" and "play" (so that I can do things like have separate address books, etc...). However, I already have LOTS of personalized settings (trackpad behavior, login items, etc) that I'd like to keep the same between the two accounts.
    Is there a way to transfer all of the user settings from one account to another?

    You'll need to copy your /Home/Library folder. Make sure you back up first before doing the following. Log out of both your Work and Play accounts. Log in to a third account with administrator privileges. Assuming you are copying from the account called "work" to the account called "play", enter the following in Terminal:
    sudo rm -rf ~play/Library (this deletes Play's Library folder.)
    sudo cp -R ~work/Library ~play/Library (this copies Work's Library folder to Play's folder.)
    sudo chown -R play ~play/Library (this fixes permissions of Play's new Library folder.)

  • Can i copy my settings from one mac to another?

    Hi
    Since I had a problem with my Mac's drive that suddenly failed (I am able to read ONLY), I replaced the internal HD with my emergency HD that I had backedup a few months before. I would like to know if there's a way to copy my settings from one mac to another? Is there a specific folder for all apps or do I have to find out each and every single file for each app?
    I need the settings for
    System (view, font, color,)
    Finder (view, etc)
    iTunes (that include all library, playlists, etc),
    Firefox (Bookmarks, settings & plug-ins),
    Safari (Bookmarks, settings & plug-ins),
    Address Book (contacts)
    Thuderbird (emails accounts, contacts, passwords, etc)
    Stickies (stickies on the dock - i have info on there unsaved)
    Filezilla (FTP infos)
    Would appreciate.
    Thnx.

    Prince Moe wrote:
    Hi
    Since I had a problem with my Mac's drive that suddenly failed (I am able to read ONLY), I replaced the internal HD with my emergency HD that I had backedup a few months before. I would like to know if there's a way to copy my settings from one mac to another? Is there a specific folder for all apps or do I have to find out each and every single file for each app?
    I need the settings for
    System (view, font, color,)
    Finder (view, etc)
    iTunes (that include all library, playlists, etc),
    Firefox (Bookmarks, settings & plug-ins),
    Safari (Bookmarks, settings & plug-ins),
    Address Book (contacts)
    Thuderbird (emails accounts, contacts, passwords, etc)
    Stickies (stickies on the dock - i have info on there unsaved)
    Filezilla (FTP infos)
    Would appreciate.
    Thnx.
    All that info is found in your user/library folder, I just did a 60 machine rollout and copied all those settings from user/library, just be forewarned that if you upgrade software those setting will not take on the machine, for example Adobe CS 3,4 will not usable by CS5.  let us know if you need more help.  Also make sure you copy most of your preferences in the user/library/prefences folder.
    Note: If you are using an identical backup with all apps and user settings, you can just copy all folders from user to your new home folder.  Remember that only if the image or backup is identical to your production OS.

  • Copying a page from one picture book into another

    Does anyone know how to copy a page from one picture book into another. I have made 2 books and would like to make a third consisting of pages from the first 2 but seem unable to do it without starting again, or at least starting from a duplicate of one and re doing all the missing pages.

    Garageclan
    Welcome to the Apple user to user assistance forums
    print each page you want to include in "book 3" to a PDF and use the send PDF to iPhoto option - this will give you the pages as images in iPhoto that you can them place into "book 3"
    See Old Toad's tutorial #19 for more details - http://web.mac.com/toad.hall/OldToadsTutorials/No._19.html - note that it is slightly different - you are only using the beginning part
    LN

  • How do I copy a photo from one folder to another one in Aperture

    I'm old and feeble      I cannot figure out how to copy a photo from one folder to another folder   and my 13 year old grandson can't figure it out either, so I feel better about it
    thanks
    canonmick

    Um ... that doesn't seem ... like a useful workflow.  When you say "folder" do you mean a Folder in Aperture (shown on the Library tab of the Inspector) or a folder in Finder?  They are not at all the same thing.
    Aperture is an image manager, with the requisite file management built-in.  Finder is a file manager.
    If you provide a full description of what are doing, and what you are trying to do, someone here can set your straight.
    Fwiw, IME, the learning curve if very long and uphill, but gentle.  What's unusual (esp. for Apple products) is that the landmass of Aperture is separated from the rest of your computer knowledge by a moat.  What I mean is, the first leap is the hardest.  After that, you'll be on firm ground, ready to explore.

  • Migrating User Settings from one local user to another

    I have an iMac running 10.5.4 with some issues (Parallels hanging at random moments). One of the tests I did to troubleshoot it was create a new user profile, and run the same (shared) Parallels machine as that new user, which seemed to fix the problem.
    I would like to being gradually copying over user preferences & data from the old account to the new one, bit by bit, so that if one of those items is causing the problem with Parallels, we can catch it.
    Is there a preferred way to copy or move over user settings from one local account to another on the same Mac? Basic files like Documents, etc. I know I can just drop into the Shared folder, but I am more concerned with Preferences, apps that use databases to point to files (like iTunes), and permissions.
    Thank you!

    V.K. (and anyone else who cares) - I finally figured out the problem: the mount point for the volume containing my Home directory ("Data") was changed by the system, but only on my primary startup volume ("System")... so when I booted from SystemClone everything was okay... but when I booted from System I had no account, no preferences, no nothing. Because the visible label on the volume containing Home was correct (even though the actual name - the mount point - was different), regardless of whether I booted from System or SystemClone, I assumed everything here was in order.
    Bottom line: when booting from System, my Data volume's visible label read "Data" .. the path to Home directory under the account's advanced settings read "/volumes/data/directoryName" ... but my Data volume's mount point read "Data 1" .. when booting from SystemClone, my Data volume's visible label read "Data" .. the path to Home directory under the account's advanced settings read "/volumes/data/directoryName" ... and my Data volume's mount point read "Data" (so everything worked).
    Lesson learned: don't assume.. check the mount point reference using Disk Utility.
    Approach validated: if I didn't have a bootable SystemClone, I would have never been able to figure this out, and repair everything without rebuilding.

  • How to retrieve the all user name from system domain(including login user)?

    Hi, I am trying to get the system domain all users name. But I unable to get the all user name except domain login user name. I used the below code. What I want to do to get the all user name from system domain. Kindly any one help me.
    Properties envVars = new Properties();
    Runtime r = Runtime.getRuntime();
    String OS = System.getProperty("os.name").toLowerCase();
         if ((OS.indexOf("nt") > -1) || (OS.indexOf("windows 2000") > -1 ) || (OS.indexOf("windows xp") > -1) )
              p = r.exec( "cmd.exe /c set" );
         BufferedReader br = new BufferedReader ( new InputStreamReader( p.getInputStream() ) );
         String line;
         while( (line = br.readLine()) != null )
              int idx = line.indexOf( '=' );
              String key = line.substring( 0, idx );
              String value = line.substring( idx+1 );
              envVars.setProperty( key, value );
         String domainDNSName = envVars.getProperty("USERDNSDOMAIN");
         String userName = envVars.getProperty("USERNAME");
         System.out.println("\n\n\n DOMAIN NAME == "+domainDNSName +" USERNAME == "+userName);
    Thanks & Regards
    Palani

    Thanks kajbj,
    I don't know, How many users in domain. I neet to get all the user names from my domain. User like A, B,C,D, E,F. I need to get this users name.
    public class Env {
         public static void main(String[] args) {
              System.out.println("USERDOMAIN: " + System.getenv("USERDOMAIN"));
              System.out.println("USERNAME: " + System.getenv("USERNAME"));
    Here , I am getting the login user name only. So i needs all user name. How to retrive or get this.
    Regards
    Palani

Maybe you are looking for

  • Reporting time taking too much time

    Hi Experts, I created one query one of my data target and i executed query, it takes too much time, can any one tell me how can i resolve this issue? please help me out? Thanks in advace David

  • How do i transfer files from external hd to new hd in macbook pro

    Hi Totally new to upgrading Mac.  I Backed up my hd to a an external hd. Upgraded my hd to 1tb. How do I make the transfer? The new hd does show in disk utility. Do I have to format this hd? Really not sure what to do next. Thanks

  • Access portal system details in Web Dynpro ???

    Hello All, I have a requirement such that in my Web Dynpro application, I need to figure out that the backend R/3 it is trying to connect to, is it a unicode or a non unicode system. For this purpose, we maintain an additional alias name for the port

  • JDBC adapter performnce in PI

    Hi, Regarding JDBC adapter in PI 7.0 and performance I have below 2 queries: 1. What are the different ways in which we can measure the performance of various components (IS, AE etc) in a JDBC scenario. 2. How to determine what is the optimum number

  • Controlling the share permission when writing a text file

    I have several application that writes a delimited text file to a file share.  Another application, not a LabVIEW application then reads the delimited text file.  When my application is creating and/or writing to the delimited text file, is there a w