Assistance with Powershell custom attribute population

I'm currently undertaking an exchange 2003 to exchange 2010 migration and as part of this am having to redesign the email address policies. Our legacy recipient policies have worked well by targeting exchange alias but in 2010 this won't work.
We have a number of exchange domains and in order to update the email addresses for a group of users we have decided to use custom attribute 15 to target these AD groups, however updating this manually for over 2000 users would prove very time consuming.
Exchange 2010 seems to be geared towards powershell and as it's still early days in my knowledge am looking for assistance.
Does anyone know a powershell command I can run to update custom attribute 15 for users of a specific security group?
Many Thanks

I am no exchange expert but also not sure what you mean by custom attribute 15. Since you want to update "users" in a specific "group" I assume this will be in Active Directory?
If so, you can use the AD cmdlets to get the job done. On a machine that has AD users and computers installed you can do something like this:
Import-Module ActiveDirectory
Get-ADGroupMember -Identity groupName | ForEach-Object{
Set-ADUser -Identity $_ -Replace @{customeAttributeName = "Replacement"}
This hasn't been tested as I do not have an environment to test in, and not sure on the custom attribute name or what needs to be replaced with, so you will need to replace groupName with the group in question, customAttributeName with the correct name and
"Replacement" with what you are replacing.
If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful.
Don't Retire Technet

Similar Messages

  • Using Rich Text Editor with a Custom Attribute

    Hello All,
    Can anyone please tell me as how can I use the Rich Text Editor with a Custom Attribute?
    I want to create a custom attribute based on text datatype, but when entering the value for this attribute in a Custom Item, portal shows a normal textarea. I want that the user should see the Richt Text Editor.
    Thanks for help.
    Regards

    Hi,
    Can you tell me what steps you are using to produce this, and which Portal version you are using. When I tried it, I wasn't able to reproduce it. Here are my steps:
    1) Created Custom Item Type, based on Text, under
    Page Groups > Shared Objects > Item Types
    2) Selected Three attributes (Description, Name, Publish Date). Note Text and Display Name were already selected
    3) In Add Item Wizard, configured list to allow for my
    custom item type selection.
    4) Then I was able to see the Rich Text Editor when editin
    my custom item type.
    Regards,
    J.

  • Problem with setting custom attribute and it being searchable

    I'm having an issue with setting a custom attribute and having it be searchable using Portal 10.1.4. The situation that we have is that we initially added a bunch of files to Oracle Portal using webdrive. Later on, we decided that we needed another custom attribute called "Pinned Item" that will be used for searching (boolean value) and gave it a default value of false. The attribute was then added to the "File" item type in the "Shared Objects" group.
    It appears that since this attribute wasn't initially available on the file object, we couldn't search on it so we decided to set it programatically. First, I tried using wwsbr.set_attribute but it errored out seemingly because the value wasn't set in the first place. If I set a value first by using the web front end, I could then use the set_attribute procedure.
    So, I moved on to using wwsbr_api.modify_item and it appears to set it (although everything is being set to false until I changed it to "text" instead of "boolean" which is OK because that's what I wanted anyway... see metalink bug 390618.1). I'm using the method outlined in metalink doc 413079.1. When I do set it to a "1", and edit the item the check box is checked indicating that it is set correctly. And if I just click "OK" to save the attributes after I open it everything works like it should.
    However, the advanced search (and custom search portlet) and the search APIs are not picking it up. I'm not sure if I'm hitting Metalink bug ID 5592472 or not as that's using the "set_attribute" procedure instead of the modify_item procedure. And their "workaround" of setting the attribute in the UI isn't really feasible for a couple thousand files.
    So far I've tried the following things to get it working:
    1. I am calling wwpro_api_invalidation.execute_cache_invalidation
    2. I have executed wwv_context.sync
    3. I cleared the page group cache
    4. I invalidated all of the web cache
    Does anyone else have any other suggestions?

    I'm having an issue with setting a custom attribute and having it be searchable using Portal 10.1.4. The situation that we have is that we initially added a bunch of files to Oracle Portal using webdrive. Later on, we decided that we needed another custom attribute called "Pinned Item" that will be used for searching (boolean value) and gave it a default value of false. The attribute was then added to the "File" item type in the "Shared Objects" group.
    It appears that since this attribute wasn't initially available on the file object, we couldn't search on it so we decided to set it programatically. First, I tried using wwsbr.set_attribute but it errored out seemingly because the value wasn't set in the first place. If I set a value first by using the web front end, I could then use the set_attribute procedure.
    So, I moved on to using wwsbr_api.modify_item and it appears to set it (although everything is being set to false until I changed it to "text" instead of "boolean" which is OK because that's what I wanted anyway... see metalink bug 390618.1). I'm using the method outlined in metalink doc 413079.1. When I do set it to a "1", and edit the item the check box is checked indicating that it is set correctly. And if I just click "OK" to save the attributes after I open it everything works like it should.
    However, the advanced search (and custom search portlet) and the search APIs are not picking it up. I'm not sure if I'm hitting Metalink bug ID 5592472 or not as that's using the "set_attribute" procedure instead of the modify_item procedure. And their "workaround" of setting the attribute in the UI isn't really feasible for a couple thousand files.
    So far I've tried the following things to get it working:
    1. I am calling wwpro_api_invalidation.execute_cache_invalidation
    2. I have executed wwv_context.sync
    3. I cleared the page group cache
    4. I invalidated all of the web cache
    Does anyone else have any other suggestions?

  • SES Filter - Adding Multiple Filters with same custom attribute

    Hi,
    I have added custom search attributes and am able to add a filter to the doOracleSearch method.
    filter[0] = new Filter(new Integer(100), "NUMBER", "equals", 10020);
    Now I have to add another filter for same search attribute with or condition, how can I do that..
    I tried following..
    filter[0] = new Filter(new Integer(100), "NUMBER", "equals",10020);
    filter[1] = new Filter(new Integer(100), "NUMBER", "equals", 10049);
    But how do I specify it is or and the above code is not working.
    Thank you.
    Vasu.

    Here is an example of this using 11g. Note you will need to login programatically if data is secured.
    // Create search service and set SOAP URL
    OracleSearchService searchService = new OracleSearchService();
    searchService.setSoapURL("http://myserver:7777/search/query/OracleSearch");
    // Get data group to search
    DataGroup dataGroup = new DataGroup();
    dataGroup.setGroupName("MyGroup");
    DataGroup[] dataGroups = new DataGroup[1];
    dataGroups[0] = dataGroup;
    // Get list of all attributes to fetch
    Attribute[] attributesAll = searchService.getAllAttributes("en");
    ArrayList<Integer> attributeIds = new ArrayList<Integer>();
    for(Attribute a: attributesAll)
         attributeIds.add(a.getId());
    Integer attributeIdArrayAll[] = new Integer[attributeIds.size()];
    attributeIdArrayAll = attributeIds.toArray(attributeIdArrayAll);
    // Create filters (BE SURE THE FILTER ID IS CORRECT - I do not suggest you hard-code it but rather iterate through list of all attributes above and get ID that way)
    Filter[] myFilters = new Filter[2];
    myFilters[0] = new Filter(124, "Number", "EQUALS", "129224");
    myFilters[1] = new Filter(124, "Number", "EQUALS", "123730");
    // Query (BE SURE TO USE "or" as the operator between filters)
    OracleSearchResult result = searchService.doOracleSearch("", 0, 50, false, false, dataGroups, "en", null, true, "or", myFilters, attributeIdArrayAll);
    // Get count
    int hits = result.getEstimatedHitCount().intValue();
    // Print results
    ResultElement[] resElements = result.getResultElements();
    for(int i = 0; i < resElements.length; i++)
    // Get document
    ResultElement doc = resElements;
    Hope this helps!

  • Assistance with Sawmill Custom Reports

    After successfully implementing a pair of S650 WSAs, I am now being asked by our management for various reports.  I have produced a number of custom Sawmill reports which provide most of the information needed, but I am having trouble trying to produce one report.  The requirement is to show a breakdown of sites vsisited for each user, including the time spent, by month, such as in this example:
    Name
    Date
    Website
    Time spent
    Total per month
    Joe Bloggs
    1.3.10
    www.e-bay.co.uk
    1.30 hrs
    Joe Bloggs
    4.3.10
    www.First Choice.co.uk
    45 mins
    Joe Bloggs
    6.3.10.
    www.Boats4us.com
    25 mins
    2.40 hrs
    Paul Smith
    2.3.10
    www.Facebook.com
    3.45 hrs
    Paul Smith
    8.3.10
    www.gjw.co.uk
    25 mins
    Paul Smith
    9.3.10
    www.fashion.com
    4  mins
    Paul Smith
    12.3.10
    www.fashion .com
    2 mins
    5.15 hrs
    I have looked at using a Report Element of "Table with Sub-table" and, while this would work for sessions/hits, it won't show the time fields as these only appear to be available in the "Sessions" report elements.  Any help or advice on how to accomplish this task would be greatly appreicated.
    Regards,
    Kev

    Thanks for the advice Tim, I can now stop spending time trying to generate an impossible report.  I will just have to use the "Time by Server" report and filter it for a single user, although with over 600 people in our company, I will need to pick specific targets rather than produce reports covering everyone!
    Kev

  • ACS 5 search in custom attributes

    Hi there
    on ACS 5 we have the possibility to add custom attributes under System Administration > Configuration > Dictionaries > Identity > Internal xxx.
    At the moment there seems no way to search for a value of a custom attribute or even display a column with the custom attribute under Internal Users or Internal Hosts. Does Cisco have plans to implement this in the future?
    Thanks and best regards
    Dominic

    Good question, I'd like to know this as well for the netscreens. For junos, this is how I tried to do it (you would drop the "netscreen" from yours, but not sure if you would add both as mandatory)
    Acs4.x setup
    junos-exec
      local-user-name=readonly
    acs5.2 setup
    attribute -  local-user-name
    value - readonly
    mandatory
    # junos config
        login {
            class admin {
                idle-timeout 30;
                permissions all;
            class read-only {
                idle-timeout 30;
                permissions [ view view-configuration ];
            user admin {                                 
                class admin;                 
            user readonly {                                 
                class read-only;  
    The problem I have though, is this fixes my login to work to my JunOS devices, but it breaks the authentication to my Cisco IOS devices. The AAA logs show that the authentication succeeded, but the router says "authorization failed". Once I remove either the attribute from my shell profile, or make it optional then the Cisco router works for auth, but the JunOS device stops working (The username it tries to use is "remote" instead of the user I am trying to authenticate with).

  • Help Pls: Create New User Form and display custom attributes +++

    Hi All,
    I am trying to create a user screen where a user would see all the organizations he is responsible for and clicking on the organization he would see the certain attribute of all the users that belong to the organization. (Kind of report)
    Account attribute need to be defined with 2 custom attributes:
    1. Organizations Responsible for
    2. Belongs to which organization.
    3. Status
    The first 2 attributes are used to define the organization heirarchy (we can't use the org heirarchy as is in IDM).
    I am just starting on the Sun IDM (very new to the product). Could you please let me know how this could be done? Which form I need to modify and any other changes I need to make.
    Thanks a lot and have a pleasant day,
    Ritesh
    PS: I know this is a long question but i really don't know how to better explain the problem.

    A workaround is to write a PL/SQL procedure to render the custom item (pass in each attribute as a paramter and then use htp.p to print it whatever format you want). You can then disable the default display of attributes (i.e. edit the style so none of the attributes are rendered).
    Hope that helps,
    Mark

  • Customs Attributes in Address List

    Hi, 
    I would like to create an Address list with data from Custom attributes. We have entered details such as Name, Designation, etc. in Arabic character in those custom attributes and would like to have an address list in Arabic. Any suggestion would be appreciated.
    Fazal Ur Rehman Shah | Senior Consultant

    Hi,
    Do you mean you want to create an address list for users whose Custom Attributes(Name, Designation etc.) are Arabic characters?
    We can configure these users with another Custom Attribute 15 value to Arabic, then use the following command to filter these users to an address list:
    New-AddressList -Name "Arabic" -RecipientFilter {(RecipientType -eq 'UserMailbox') -and (CustomAttribute15 –like Arabic)}
    Thanks,
    Winnie Liang
    TechNet Community Support

  • Need to create new users in Office 365 with custom attributes from a csv file

    I am exporting users from an active directory environment and then deleting them from AD. They are Alumni and will no longer be in AD.
    I have a csv file with the following fields that I need to use to create new Alumni email boxes in Office 365 for. I need the CustomAttributes because my Dynamic Distribution Groups use them. I am fairly new to PowerShell and have been unable to get this
    to work. I suspect I may have to split it into two parts, but am not sure how to proceed. Any assistance would be appreciated. I was directed here from the Office 365 community.
    Import-Csv -Path c:\CSVfiles\CreateAlumni.csv | ForEach-Object {
       New-MsolUser -FirstName $_.FirstName -LastName $_.LastName
       -UserPrincipalName $_.UserPrincipalName
       -DisplayName "$($_.FirstName) $($_.LastName)"
       -Password $_.Password
       -CustomAttribute1 $_.CustomAttribute1
       -CustomAttribute3 $_.CustomAttribute3
       -CustomAttribute10 $_.CustomAttribute10
       -CustomAttribute11 $_.CustomAttribute11
       -CustomAttribute12 $_.CustomAttribute12
       -LicenseAssignment 'domaincom:EXCHANGESTANDARD_ALUMNI'
       -UsageLocation US

    Ok, it wasn't stopping after 2 iterations. What I was seeing was 2 failures. The first was the Get-Mailbox command and the second was when it tried to assign attributes. For some reason it is not looping when it fails. It just goes on and tries to assign
    the Custom Attributes. I added writes in to tell me what was happening.
    ### Check if mailbox is provisioned yet
    Write-Host "Checking if mailbox is provisioned yet..." -foregroundcolor yellow
    $found = $false
    $count = 0
    Do {
    try {
    Get-Mailbox -Identity $_.UserName -ErrorAction Stop
    $found = $true
    Write-Output 'Mailbox found. Details:'
    Get-Mailbox -Identity $_.UserName
    } catch {
    Write-Output 'Sleeping'
    $count++
    Start-Sleep -Seconds 5
    If ($count -ge 12) {
    Write-Output 'Mailbox not found. Quitting.'
    $found = $true
    } Until ($found)
    Write-Host "Adding Custom Attributes to User" -foregroundcolor yellow
    Set-Mailbox -Identity $_.UserName -CustomAttribute1 $_.CustomAttribute1 -CustomAttribute3 $_.CustomAttribute3 -CustomAttribute10 $_.CustomAttribute10 -CustomAttribute11 $_.CustomAttribute11 -CustomAttribute12 $_.CustomAttribute12
    Write-Output "User has been Provisioned in Office 365!" -foregroundcolor yellow
    Checking if mailbox is provisioned yet...
    The operation couldn't be performed because object 'Joe.Cool2003' couldn't be found on 'CO1PR07A002DC01.NAMPR07A002.prod.outlook.com'.
        + CategoryInfo         
    : NotSpecified: (:) [Get-Mailbox], ManagementObjectNotFoundException
        + FullyQualifiedErrorId : [Server=CO1PR07MB125,RequestId=e1aabda1-01e4-4f68-984e-e20be0975242,TimeStamp=5/22/2014 4:23:59 AM] [FailureCategory=Cmdlet-ManagementObj
       ectNotFoundException] 2788FB48,Microsoft.Exchange.Management.RecipientTasks.GetMailbox
        + PSComputerName        : pod51038psh.outlook.com
    Mailbox found. Details:
    The operation couldn't be performed because object 'Joe.Cool2003' couldn't be found on 'CO1PR07A002DC01.NAMPR07A002.prod.outlook.com'.
        + CategoryInfo         
    : NotSpecified: (:) [Get-Mailbox], ManagementObjectNotFoundException
        + FullyQualifiedErrorId : [Server=CO1PR07MB125,RequestId=16a8a2bc-333a-455c-8504-e0b99c44c334,TimeStamp=5/22/2014 4:24:00 AM] [FailureCategory=Cmdlet-ManagementObj
       ectNotFoundException] 2788FB48,Microsoft.Exchange.Management.RecipientTasks.GetMailbox
        + PSComputerName       
    : pod51038psh.outlook.com
    Adding Custom Attributes to User
    The operation couldn't be performed because object 'Joe.Cool2003' couldn't be found on 'CO1PR07A002DC01.NAMPR07A002.prod.outlook.com'.
        + CategoryInfo         
    : NotSpecified: (:) [Set-Mailbox], ManagementObjectNotFoundException
        + FullyQualifiedErrorId : [Server=CO1PR07MB125,RequestId=8319d220-b9dd-492f-8182-5083cf56e58b,TimeStamp=5/22/2014 4:24:00 AM] [FailureCategory=Cmdlet-ManagementObj
       ectNotFoundException] C7844A24,Microsoft.Exchange.Management.RecipientTasks.SetMailbox
        + PSComputerName       
    : pod51038psh.outlook.com
    User has been Provisioned in Office 365!
    Of course the user has been provisioned, but the CustomAttributes have not been assigned. :(

  • Issue with Sorting by Custom Attributes

    In our custom SES query application, I am trying to implement sorting at the custom attribute level. I am having difficulty in understanding exactly how to set the options on doOracleOrganizedSearch() to achieve the desired result.
    We have a table based content source and allow a user to search via custom search attribute. We are also going to allow them to sort by custom attribute.
    For example, say we have a Project content source and one of the attributes is "Client Name". Users are going to be able to sort by client name (A-Z and Z-A). I have a prototype working but it only seems to work if I set topN to a very high number.
    I want to bring back the first 10 documents sorted by Client Name A - Z and allowing paging to the next set of sorted results. My prototype works if I set topN to 1000 (more than the # of results) but does not work if I set it to 10 (# of results I want to display per page).
    Below if my code. Note I am not setting the group attribute or the cluster list. Perhaps this is the issue?
    Many thanks in advance!
    OracleResultContainer results = service.doOracleOrganizedSearch
    (this.m_query, // query
    this.m_docsRequested, // topN
    this.m_startIndex, // startIndex
    new Integer(10), // docsRequested
    this.m_dupRemoved, // dupRemoved
    this.m_dupMarked, // dupMarked
    this.m_searchDataGroup, // groups
    this.m_queryLang, // queryLang
    this.m_docLang, // docLang
    this.m_returnCount, // returnCount
    this.m_filterConnector, // filterConnector
    filters, // filters
    this.m_fetchAttributeNames, // fetchAttributeNames
    null, // searchControls
    null, // groupAttr
    this.m_sortAttributes, // sortAttrList
    null); // clusterList

    Hi Nikola,
    in 9.0.1 even if you rewrite the web interface you can't sort files by custom attributes setting a SortSpecification to a Folder. You can only sort by base attributes with getItems(). To get item sorted on custom attributes you must perform a search (a lot more codelines).
    Regards, Alessandro

  • Using LOV with bind var as custom attribute?

    I have an Portal LOV which uses a bind variable.
    Can I use this LOV as a custom attribute? If so, how do I specific the bind variable value?
    In the display option of the attribute I tried LOV_NAME(LOV_Bind => 'value'), but the LOV is not applied.

    It's been quite a while, but I think I remember trying this and not being able to achieve it. You can use a LOV with a bind variable in a report or in a form, or similar, but there is no way in an item to from specify where to get the bind variable. My suggestion if this is a requirement would be to use a portal form which submits to a stored procedure or pl/sql generated form to gather the attributes and then programmatically create the item using the APIs. Takes a bit of work, but gets you exactly what you described above.
    Rgds/Mark M.

  • Problem using multiple choice LOV with custom attribute in IAS 10.1.2.0.2

    Hi
    When aplying a multiple choice and selecting multiple selection and saving in the content area , everything looks fine .
    However when looking at the page the selection is only the first one selected and not the miltiple choices I made
    can someone tell me what is going on , does the miltiple selection with custom attribute
    works ??
    thanks in advance
    Igal

    Hi there,
    I don't really understand what you're doing but I used lot of LOV in custom attributes on my custom items and everything works fine.
    Can you explain more your problem ?

  • OIM 11gR2 - custom attribute with illegal binding on Create User form in published sandbox

    Hi,
    I think I have managed to paint myself into a corner!
    In OIM 11gR2 I have added a number of custom attributes to the "User Form" - some Text-, some Lookup-type attributes.
    While customizing the "Create User" page within a sandbox and adding a SelectOneChoice item and fiddling around with its binding, I was distracted by a phone call and the browser timed out.
    The binding property on the new item is now not correct and the sandbox has unfortunately been published, and I am now unable to enter the "Create User" page - when I try, I get the following:
    <Sep 23, 2013 2:39:11 PM CEST> <Warning> <oracle.adf.view.rich.component.fragment.UIXRegion> <ADF_FACES-00009> <Error processing viewId: /user/createView URI: /oracle/iam/ui/runtime/form/view/pages/userCreateForm.jsff actual-URI: /oracle/iam/ui/runtime/form/view/pages/userCreateForm.jsff.
    javax.el.PropertyNotFoundException: Target Unreachable, 'ekstraresource1__c' returned null
            at com.sun.el.parser.AstValue.getTarget(AstValue.java:108)
            at com.sun.el.parser.AstValue.isReadOnly(AstValue.java:149)
            at com.sun.el.ValueExpressionImpl.isReadOnly(ValueExpressionImpl.java:248)
            at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer._getUncachedReadOnly(EditableValueRenderer.java:486)
            at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer.cacheReadOnly(EditableValueRenderer.java:416)
            at oracle.adfinternal.view.faces.renderkit.rich.LabeledInputRenderer.beforeEncode(LabeledInputRenderer.java:128)
            at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:340)
    <Sep 23, 2013 2:39:11 PM CEST> <Warning> <oracle.adf.view.rich.component.fragment.UIXRegion> <ADF_FACES-00009> <Error processing viewId: /catalog-tf/cart-details URI: /oracle/iam/ui/catalog/pages/cart-details.jsff actual-URI: /oracle/iam/ui/catalog/pages/cart-details.jsff.
    javax.el.PropertyNotFoundException: Target Unreachable, 'ekstraresource1__c' returned null
            at com.sun.el.parser.AstValue.getTarget(AstValue.java:108)
            at com.sun.el.parser.AstValue.isReadOnly(AstValue.java:149)
            at com.sun.el.ValueExpressionImpl.isReadOnly(ValueExpressionImpl.java:248)
            at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer._getUncachedReadOnly(EditableValueRenderer.java:486)
            at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer.cacheReadOnly(EditableValueRenderer.java:416)
            at oracle.adfinternal.view.faces.renderkit.rich.LabeledInputRenderer.beforeEncode(LabeledInputRenderer.java:128)
            at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:340)
    Caused By: java.io.IOException: javax.el.PropertyNotFoundException: Target Unreachable, 'ekstraresource1__c' returned null
            at oracle.adfinternal.view.page.editor.renderkit.PageCustomizableRenderer.encodeAll(PageCustomizableRenderer.java:764)
            at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
            at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
            at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
            at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
            at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
    etc.
    Of course the sandbox should not have been published - but it is - and I am stuck trying to figure out how to somehow undo this mess.
    Is it possible to clean up this mess by diving to the database and removing some rows from the right tables - or perform some other operations undo my mistake?
    Thanks in advance,
    - Tom

    oim version is oim 11gR2 with BP4

  • Powershell script to set custom attribute on mailuser returns WARNING: The command completed successfully but no settings of user have been modified.

    I am trying to write a script to enable a mailuser (I do know the difference between mailuser and mailbox) and set a custom attribute for that mailuser.  Every time I run the script I get "WARNING: The command completed successfully but no settings
    of <User DN> have been modified."  Both commands being invoked work when typed manually into the exchange management shell on the exchange server itself.  I am using the same administrator account in the script, and when I login to the
    exchange server to manually run the commands, so it shouldn't be a permission issue.  Here is my script so far.  If anyone can shed some light on what I'm doing wrong, I'd appreciate it.
    $excel = new-object -com excel.application
    $wb = $excel.workbooks.open("c:\temp\testmail8.xlsx")
    $ws = $wb.Worksheets.Item(1)
    $row = 1
    $s = New-PSSession -ConfigurationName microsoft.exchange -ConnectionUri http://<Exchange Server Name>/powershell -Credential [email protected]
    Do {
    $Email = $ws.Cells.Item($row, 1).Value()
    $Cat = $ws.Cells.Item($row, 2).Value()
    invoke-command -Session $s -ScriptBlock {Enable-MailUser -ExternalEmailAddress $($args[0][0] + "@domain.com") -Identity $($args[0][0])} -ArgumentList (,$Email, $Cat)
    invoke-command -Session $s -ScriptBlock {Set-MailUser -Identity $($args[0][0]) -CustomAttribute1 $($args[0][1])} -ArgumentList (,$Email, $Cat)
    $row++
         } While ($ws.Cells.Item($row,1).Value() -ne $null)
    $excel.quit    
    Exit-PSSession

    Hi,
    I'm not sure where is wrong in your script. If you want to get more help about the script troubleshooting, I recommand you to ask a question in Script Center forum for more professional answers:
    http://social.technet.microsoft.com/Forums/scriptcenter/en-US/home?forum=ITCG
    As a workaround, please directly create a mail user in EAC and set related custom attribute to have a try.
    Thanks,
    Winnie Liang
    TechNet Community Support

  • How to add ProxyAddress attribute to multiple users? with powershell

    I need to add the attribute ProxyAddress several users at once, in AD 2008 R2. with powershell.
    Thanks beforehand.

    Hi,
    Use Set-ADUser:
    http://ss64.com/ps/set-aduser.html
    See the -Add parameter.
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

Maybe you are looking for