Script using Update-Recipient

Working on a Script that will be run as a scheduled task.  I have most of the script setup but running into one stopping point that's not working how I want it to.
The script runs a Get-Mailuser with some filters that is saved into a variable.
I then have a ForEach loop running through those users and setting them so that the EmailAddressPolicyEnabled is set to False. Then it does and Update-Recipient against that user to mail enable them.  Unfortunately some users still have something
wrong with the account so that Update-Recipient fails.  But I haven't been able to detect that failure so that I can have my script do something else if that fails.  Any Ideas on how I can determine if Update-Recipient worked or not.
Jeff C

Hi,
I would like to help you, but I'm not familiar with the script. I recommend you ask this question on the Script forum which is staffed by more experts specializing in this kind of problem. You might get a better answer there.
http://social.technet.microsoft.com/Forums/scriptcenter/en-US/home?category=scripting
Thanks for understanding.
Best regards,
If you have feedback for TechNet Subscriber Support, contact
[email protected]
Belinda Ma
TechNet Community Support

Similar Messages

  • As i am fresher Please share the doc of ECMA script using java script in SharePoint 2013 also how we can insert,update,delete records in list using ECMA script.

    As i am fresher Please share the doc of ECMA script using java script in SharePoint 2013 step by step also how we can insert,update,delete records in list using ECMA script.
    Thanks and Regards, Rangnath Mali

    Hi,
    According to your post, my understanding is that you want to use JavaScript to work with SharePoint list.
    To create list items, we can create a ListItemCreationInformation object, set its properties, and pass it as parameter to the addItem(parameters) function
    of the List object.
    To set list item properties, we can use a column indexer to make an assignment, and call the update() function so that changes will take effect when you callexecuteQueryAsync(succeededCallback,
    failedCallback). 
    And to delete a list item, call the deleteObject() function on the object. 
    There is an MSDN article about the details steps of this topic, you can have a look at it.
    How to: Create, Update, and Delete List Items Using JavaScript
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • How can I script Firefox updates using vbScript, PowerShell or C#?

    I would like to script Firefox updates using vbScript, PowerShell or C#, are there any API calls I use to do this? There are several different OS version versions that I support and auto update is not an option. I do updates at a specific time of the month. I would like to write a script that would download and install the update for the currently installed version of Firefox (32 or 64 bit) for the version of the OS (32 or 64bit). I can detect the OS version and the Firefox version. I can download updates but I do not want to hard code anything.

    hello, for some documentation on how the firefox updates work, please refer to https://wiki.mozilla.org/Software_Update (also the links at the bottom of the page!).

  • Finished script: Use grep find/change to fill in a supplied table of contents

    This script is now complete, and has been the subject of most of my previous posts. Just in case anyone wanted to know what the finished script ended as, here it is.
    Thanks so much to all. A lot of really helpful folks on this board are very responsible for the success of this task. This script is to be one of hopefully many in the creation of our records. But it's a huge leap forward. Thanks again to everyone that helped.
    Cheers,
    ~Nate
    Task:
    Automatically find town names in listings, and fill in table of contents template on page 2 accordingly.
    Example of page 2 toc, initially:
    Example of a page of content. The town names are what need to be referenced on the TOC:
    Example of page 2 toc once script is finished:
    Because of the need to include the transaction dates on the TOC (comes as a provided, tagged-text file), a simple Indesign-generated TOC can't be used alone.
    This script uses an Indesign-generated TOC that's on a master page called "T-tocGen" ... It then uses grep search and replaces to grab the needed information, and insert it into the page 2 TOC.
    The script will update a generated TOC and then search for an instance of a page number, and town name. The generated toc lists all included towns in the following format:
    (line start)## tab townName(line end)
    In Grep, this would be (please note, extra \ for \d and \t ... javascript needs that for some reason):
    ^\\d+\\t(.*)$
    After the script gets the info it needs from a found instance of the above, it replaces that line with "---", to prevent that line from being picked up once again.
    The script with then place the needed page number in it's rightful place on page 2, replacing the XX.
    A while loop is used to repeat the above process until there are no longer any instances of "^\\d+\\t(.*)$" present.
    Not every town runs every issue, so once the script is done, it removes all remaining instance of "XX" on the page 2 TOC.
    FINAL CODE:
    TOC replace
    This script will use grep find/change methods to apply page numbers in
    tocGen to the XX's on page2TOC.
    // define the text frame of generated TOC
        var tocGenFrame  = document.masterSpreads.item("T-tocGen").pages.item(0).textFrames.item(0);
    // udpate generated TOC ... store contents in tocGenStuff
        var tocGenStuff = updateTOCGen();
    // set variable for while loop
    var okGo = "1";
    // while okGo isn't 0
    while(okGo.length!=0)
    // get town info from tocGen
    getCurrentTown();
    // replace XX's with tocGen info
    replaceTown();
    // grep find ... any remaining towns with page numbers in tocGen?
    app.findGrepPreferences = app.changeGrepPreferences = null;
    app.findGrepPreferences.findWhat = "^\\d+\\t(.*)$";
    // set current value of okGo ... with any instances of above grep find in tocGen
    okGo = tocGenFrame.findGrep();   
    // grep find/change all leftover XXs in page2TOC
    app.findGrepPreferences = app.changeGrepPreferences = null;       
    app.findGrepPreferences.findWhat = "^XX\\t";
    app.changeGrepPreferences.changeTo = "\\t";
    app.activeDocument.changeGrep();  
    // clear grep prefs
    app.findGrepPreferences = app.changeGrepPreferences = null;
    //  functions                  //
    function getCurrentTown()
    // grep options   
    app.findChangeGrepOptions.includeLockedLayersForFind = true;
    app.findChangeGrepOptions.includeLockedStoriesForFind = true;
    app.findChangeGrepOptions.includeHiddenLayers = true;
    app.findChangeGrepOptions.includeMasterPages = true;
    app.findChangeGrepOptions.includeFootnotes = true;
    // grep find:  startLine anyDigits tab anyCharacters endLine
          app.findGrepPreferences = app.changeGrepPreferences = null;
          app.findGrepPreferences.findWhat = "^\\d+\\t(.*)$";
    // get grep find results      
    currentGen = tocGenFrame.findGrep();  
    // store grep results content into currentLine
    currentLine = currentGen[0].contents;
    // match to get array of grep found items
    currentMatch = currentGen[0].contents.match("^\\d+\\t(.*)$");
    // second found item is town name, store as currentTown
    currentTown = currentMatch[1];
    // change current line to --- now that data has been grabbed
    // this is because loop will continue as long as the above grep find yields a result
           app.findGrepPreferences.findWhat = "^\\d+\\t"+currentTown+"$";
                  app.changeGrepPreferences.changeTo = "---";
                tocGenFrame.changeGrep(); 
    function replaceTown()
    app.findChangeGrepOptions.includeLockedLayersForFind = true;
    app.findChangeGrepOptions.includeLockedStoriesForFind = true;
    app.findChangeGrepOptions.includeHiddenLayers = true;
    app.findChangeGrepOptions.includeMasterPages = true;
    app.findChangeGrepOptions.includeFootnotes = true;
    // find: XX currentTown .... replace with: currentLine
        app.findGrepPreferences = app.changeGrepPreferences = null;
        app.findGrepPreferences.findWhat = "^XX\\t"+currentTown+" \\(";
        app.changeGrepPreferences.changeTo = currentLine+" \(";
    app.activeDocument.changeGrep();   
    function updateTOCGen()
    //set vars ... toc text frame, toc master pag
        var tocGen  = document.masterSpreads.item("T-tocGen").pages.item(0).textFrames.item(0);
        var tocGenPage  = document.masterSpreads.item("T-tocGen").pages.item(0);
    //SELECT the text frame generatedTOC on the master TOC
        tocGen.select();
    //Update Table of Contents by script menu action:
        app.scriptMenuActions.itemByID(71442).invoke();
    //Deselect selection of text frame holding your TOC:
        app.select(null);
    //store contents of toc text frame in variable
        var tocGenText = tocGen.contents;
    //return contents of tocGen
        return tocGenText;

    Thanks for the reply.
    You are correct but the problem is there are three rows, One row is 100% black, the second is 60% black and the third is 40% black. I want to change the black to blue, the 60% black to an orange and the 40% black to a light shaded blue. In the find/change option you can select the tint you want to find and replace but yea.. does work on table cells.. oddly enough.

  • Script to update EXIF data in iPhoto '08

    I shoot some photos with a digital Nikon D50, and some with a Leica M3 (35mm film). The pictures from the digital Nikon are encoded with plenty of detail in the EXIF tags, but the digitized images from the Leica and the 35mm film have only a few tags from the scanner.
    I wanted a script that would update the desired EXIF tags direct in iPhoto. I looked around on the Internet at other scripts, and wrote a simple script to update a few EXIF tags on selected images in iPhoto.
    I hope this script is of use to others.
    http://movingtomac.blogspot.com/2008/07/script-to-update-exif-data-in-iphoto-08. html

    since we don't have your tables or data, we can not run, test, or improve posted code.
    How do I ask a question on the forums?
    SQL and PL/SQL FAQ

  • Scheduling an sql script using dbms_scheduler

    Hi Experts,
    I am having an oracle 10g database on windows platform. I have an sql script which has a normal set of sql statements (insertion and updation).
    I would like to schedule to run this sql script using dbms_scheduler but I've gone through certain sites and came to know that it's not possible to schedule an sql script using dbms_scheduler. Please let me know how I can schedule this script using dbms_scheduler.

    It is possible - in 10g and above you can use DBMS_SCHEDULER to call an external procedure, which in this case could be a call to your SQL file.
    Get's a bit more complicated with older versions, but still doable.
    But - unless there is a really good reason why you cannot do so, move this into a PL/SQL procedure as suggested.
    Carl

  • Is it possible to run one ud script to update parms for multiple servers...

    Is it possible to run one ud script to update certain parameters in mib for multiple
    servers by giving multiple occurrences of the parameter and server id. I tried
    a ud script as follows and it seem to update the parameter for only the first
    server.
    SRVCNM .MIB
    TA_CLASS T_SERVER
    TA_OPERATION SET
    TA_SRVID 101
    TA_SRVID 102
    TA_SRVID 103
    TA_CLOPT -A -r -e srv1.err --
    TA_CLOPT -A -r -e srv2.err --
    TA_CLOPT -A -r -e srv3.err --

    From the ud's output, it looks like it used only one occurrence of the fields that
    I provided.
    "james mathew" <[email protected]> wrote:
    >
    Is it possible to run one ud script to update certain parameters in mib
    for multiple
    servers by giving multiple occurrences of the parameter and server id.
    I tried
    a ud script as follows and it seem to update the parameter for only the
    first
    server.
    SRVCNM .MIB
    TA_CLASS T_SERVER
    TA_OPERATION SET
    TA_SRVID 101
    TA_SRVID 102
    TA_SRVID 103
    TA_CLOPT -A -r -e srv1.err --
    TA_CLOPT -A -r -e srv2.err --
    TA_CLOPT -A -r -e srv3.err --

  • Script to update a field for current year

    Is it possible to have a field update to finish the current year? Example 20-- (the dashes to change to whatever year it is). I'm thinking that it's not possible but if someone knows how it can be done I would really appreciate help. Thanks 
    Sorry, I guess I need it to change the entire year, not just the ending.  THanks
    I've tried a few scripts that I found here, such as; year(dateAdd('yyyy', 1, now())) with no luck. I admit I have no knowledge of scripts and may be doing something wrong. Does the script go under the Action tab as a javascript or somewhere else (validation??) Any advice or help would be appreciated. I am using Acrobt Pro version 9.

    You can not just cut and paste scripts since one needs to be aware of the object, the object's properties, and the object's methods that may need to be changed. Form your example it looks like you are trying to use a user defined function call and without the JavaScript for the function the code you posted will not work.
    You will need to use the JavaScript Date object to obtain the current date. You can then use either the 'getFullYear()' or 'getYear()' method to the get the 4 digit year or the 2 digit year and mellenium inicator. From these numbers you can extract the 2 digit year by converting the numbers to strings and then extracting a sub string from the character string.
    The following scripts are custom calculation scripts/
    // using the getFullYear() method:
    event.value = String(new Date().getFullYear()).substr(2,4);
    // using the getYearmillenniumindicator() method:
    event.value = String(new Date().getYear()).substr(2,4);
    If you want the full year:
    // using the getFullYear() method:
    event.value = new Date().getFullYear();

  • Need help on Executing this Script to update LyncDatabase remotely

    Hi All,
             I have some problem with executing the below script (to update the LyncDB post CU4 patched on Lync Servers) remotely, but it works fine Locally(from any Lync FE machine),
    Script: Install-CsDatabase -Update -ConfiguredDatabases -SqlServerFqdn "LyncDB.Julie.local" -UseDefaultSqlPaths
    When executing locally from any Lync FE Machine(LyncFE.julie.local), its working fine "Piece of Output for your reference"
    Output:
    PS C:\Users\julie> 
    Install-CsDatabase -Update -ConfiguredDatabases -SqlServerFqdn "LyncDB.Julie.local" -UseDefaultSqlPaths
    ****Creating DbSetupInstance for 'Microsoft.Rtc.Common.Data.BlobStore'****
    Trying to connect to Sql Server LyncDB.Julie.local. using windows authentication...
    Sql version: Major: 11, Minor: 0, Build 3128.
    Sql version is acceptable.
    Checking state for database rtcxds. it use to go like this for few pages to update all 06 database
    Remote Script:
    $sessionoption=new-pssessionoption -SkipRevocationCheck
    $password=ConvertTo-SecureString -String "*******" -AsPlainText -Force
    $credential=New-Object System.Management.Automation.PSCredential("******", $password)
    $session=New-pssession -ComputerName "LyncFE.julie.local" -port 5985 -Credential $credential -Authentication
    Negotiate -SessionOption $sessionoption
    Try{
    $cmd=invoke-command -session $session -scriptblock{
    Install-CsDatabase -Update -ConfiguredDatabases -SqlServerFqdn "LyncDB.Julie.local" -UseDefaultSqlPaths
    Write-Host $cmd
    Remove-PSSession -Session $Session;
    Catch
      $RetVal = "Error23: " + $error[0].Exception.toString()
    $cmd
    Error:
    Output:
    WARNING: Install-CsDatabase failed.
    WARNING: Detailed results can be found at "C:\Users\Julie\AppData\Local\Temp\Install-CsDatabase-52517af7-39ea-482e-8ba6-166a15cf8
    4d2.html".
    Command setup failed: Active Directory error "-2147016672" occurred while searching for domain
    controllers in domain 
    "ad.*****.com": "An operations error occurred.
        + CategoryInfo          : InvalidOperation: (:) [Install-CsDatabase],
    ADTransientException
        + FullyQualifiedErrorId : BeginProcessingFailed,Microsoft.Rtc.Management.Deployment.InstallDatabaseCmdlet
        + PSComputerName        : LyncDB.Julie.local.com

    I tried both the Option, both still I'm getting the same error like the below,
    Error:
    Output:
    WARNING: Install-CsDatabase failed.
    WARNING: Detailed results can be found at
    "C:\Users\Julie\AppData\Local\Temp\Install-CsDatabase-52517af7-39ea-482e-8ba6-166a15cf8
    4d2.html".
    Command setup failed: Active Directory error
    "-2147016672" occurred while searching for domain controllers in domain 
    "ad.*****.com": "An operations error occurred.
        + CategoryInfo    
         : InvalidOperation: (:) [Install-CsDatabase], ADTransientException
        + FullyQualifiedErrorId : BeginProcessingFailed,Microsoft.Rtc.Management.Deployment.InstallDatabaseCmdlet
        + PSComputerName    
       : LyncDB.Julie.local.com

  • Create a follow up page in scripts using Duplex and Tumble Duplex in print

    How to create a follow up page in scripts using Duplex and Tumble Duplex in print mode of scripts ?

    it depends upon output device types.
    Regards
    Prabhu

  • How do I get the iTunes store to pull and use updated info from Gracenote?

    I'm helping a music group fix their CD information, which was incorrect in the Gracenote database. Gracenote made the corrections, but the iTunes store is not reflecting the changes. I verified the changes were made by inserting the CD on a PC, and, through the iTunes client, asking it to pull the track info from Gracenote. The info is correct.
    However, if you use the iTunes client to go to the store, the info in the store does not match what was pulled when sticking the CD in the drive and querying Gracenote. Also, if you go to the CD URL via a web browser to preview or purchase a digital download, the iTunes store web site is still showing the wrong information.
    How do I get the iTunes store (that is, Apple's server, not the iTunes client) to pull and use updated (correct) CD information from Gracenote?

    Geek Girl,
    The official Content Provider relationship with the Store depends how it was set up, and may be the group or their agent or a 3rd party such as TuneCore.  They can go back through the same official channel that put the tracks in the Store in the first place.
    Or, if it is simply an error, as opposed to an official change by the Artist, you can try the Feedback page:
    http://www.apple.com/feedback/itunesapp.html

  • Getting the output from a Perl script using Runtime.exec

    I cannot get the output from a perl script using Java. Can someone PLEASE help?
    I used the following code:
    Process p = Runtime.getRuntime().exec("C:\\Perl\\bin\\Perl.exe script.pl) ;
    InputSream in = p.getInputStream();
    b...
    do
    System.out.println(b);
    while ((b = in.read()) > 0)
    But there is no way that I get the output in the inputstream. If I use the command "cmd script.pl", the output is displayed in the Dos box, but also not in the inputstream.
    I will appreciate any help.

    Try this
    Process p = Runtime.getRuntime().exec("C:\\Perl\\bin\\Perl.exe script.pl) ;
    BufferedReader rd = new BufferedReader(new InputStreamReader(p.getInputStream()));
    String str;
    while((str=rd.readLine())!=null){
    System.out.println(str);
    Manu

  • Executing a script using full path in ODT 11.1.0.5.10 beta?

    Using a query window from ODT 10x, I used to be able to run a script using '@' and the path to the script. For example: '@D:\Documents\CAL.MB\Oracle\Create Scripts\Applicant\APPLICANT_TB.sql'.
    Now I get the following error:
    Command '@D:\Documents\CAL.MB\Oracle\Create Scripts\Applicant\APPLICANT_TB.sql' is not supported in query window.
    I checked the documentation, but I couldn't find an alternative way to do this. Anyone know of any alternatives?

    Use VS.NET Tools menu->Run SQL*Plus Script->Specify the full path of your filename ->Select the connection->Hit the ok button.

  • How to check/verify running sql in lib cache is using updated statistics of table

    How to check/verify running sql in lib cache is using updated statistics of table used in from clause.
    one of my application table is highly busy i.e frequent update/insert/delete.
    we gather table stats every 30 min.

    Hello, "try dynamic sampling" = think "outside the box", maybe hit two birds with same stone.
    As a matter of fact, I was just backing up your statement: "30 minutes seems pretty extreme"
    cheers

  • Using UPDATE in reporting

    Hi all,
          I require the procedure to use UPDATE DB table in reporting , Such as in case of LFA1, I want to update LFA1 directly and change some of the mentioned fieldss to Hardcoded values and some of them are to be initilased from the internal table.
    Kindly can anyone give the syntax of how to use UPDATE DB  along with some key fields...
    Regards
    Nagaraj

    Hi,
    cant you use
    xk02 for changing the vendor master details...
    or else  select the record from lfa1
    which you want to update into itab.
    now change the itab
    by using modify itab.
    and use update lfa1 from table itab.
    but this is not recommended
    i think you can use XK02  ( if so you can use it)
    thanks & regards,
    venkatesh

Maybe you are looking for

  • NFe em processamento no ERP e OK no GRC mas teve erro de atualização do ERP

    Boa tarde, Tem acontecido que ao tentar atualizar a NFe, ocorre o erro de atualização (tabela /XNFE/NFE_HISTconsta 108), porém no monitor GRC a NFe está com status OK (verde). Ao verificar a tabela /XNFE/NFE_HIST, o registro de wasstat 05 (Result Rec

  • Using static variable in orchestration for each message

    Once a file is dropped to our Biztalk server I am capturing data from each message. However, I need to assign a batchID for this file that I will write to the database along with the data. How do I build my orchestration so that the code I'm using to

  • Error 109 when Exporting as a PDF... please help!

    I have an InDesign file that I want to export as a PDF. I've done this MANY times before; however, now the PDF that is generated from within InDesign that says, "The document could not be saved. There was a problem reading this document (109)". How c

  • How do i send my aol downloads to acrobat cloud?

    how do i send my aol downloads to acrobat cloud?

  • Content file download failed.

    I haven't been able to find anything on this anywhere. Trying to get Windows 8.1 Update (KB2919355) to download, but it keeps failing.  I'm using WSUS 3.2 on Server 2008 R2, 156GB free space on E drive. This error has been occurring since April, but