Maintenance Mode never ends

I want to put a scom gruop into Maintenance. The Management Server is not member of it.
When I use the following Powershell Script with SCOM 2012....
Import-Module OperationsManager
$Instance = Get-SCOMGroup -displayname "<Group>"
$Time = ((Get-Date).AddMinutes(90))
Start-SCOMMaintenanceMode -Instance $Instance -EndTime $Time -Comment "Automatic WSUS Updates" -Reason "PlannedOperatingSystemReconfiguration"
....the Maintenance mode never ends. I have to stop the mode manually. When I use the SCOM Console everything is fine.

In my environment, it works but may be in some delay. Moreover, you can use get-scommaintenancemode to watch whether the maintenace mode and schedule end time is correct.
You may be refer to Pete Zerge blog "r OpsMgr 2012: Group Maintenance Mode via PowerShell"
http://www.systemcentercentral.com/opsmgr-2012-group-maintenance-mode-via-powershell-the-way-it-should-be/
Roger

Similar Messages

  • SCOM 2012 Maintenance Mode PowerShell Script Problems

    I've seen other questions about this topic before, but none of them seem to address my specific problem, so I am starting a new thread.
    I am writing a script to put a single server (not a group) into maintenance mode.   Here is the command that it ultimately tries to call:
     Start-SCOMMaintenanceMode-Instance$Instance-EndTime$EndTime-Reason$Reason-Comment$Comment     
    So an exmaple would look like this:
    Start-SCOMMaintenanceMode -Instance "$Instance -EndTime "02/03/2014 15:26:00" -Reason "PlannedOther" -Comment "Testing Maintenance Mode"
    When my script tries to run this command, this is the error message that I get:
    Start-SCOMMaintenanceMode : Start time must be before end time for maintenance mode.
    Parameter name: startTime
    At C:\users\x036036\Desktop\Start-SCOMMaintenanceModeForServer.ps1:143 char:21
    +                     Start-SCOMMaintenanceMode -Instance $Instance -EndTime $EndT ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (Microsoft.Syste...anceModeCommand:StartSCMaintenanceModeCommand) [Start-SCOMMaintenance
       Mode], ArgumentOutOfRangeException
        + FullyQualifiedErrorId : ExecutionError,Microsoft.SystemCenter.OperationsManagerV10.Commands.StartSCMaintenanceModeCommand
    I've tried to look at Start-SCOMMaintenanceMode help online, but I don't see that "startTime" is a parameter.  So what is this error message talking about?  What am I missing?  

    Thanks for your help.   I didn't see your response until just now, but I have been playing around with this all since my last response.   I got it to work.  I wish I could pinpoint what exactly I changed to get it to work, but I
    feel like I've been changing so much stuff that I'm not sure any more.
    Just in case anyone finds it useful, here is the code.
    [CmdletBinding(SupportsShouldProcess=$true)]
    param
    [Parameter(Mandatory=$True,
    ValueFromPipeline=$True,
    ValueFromPipelineByPropertyName=$True,
    HelpMessage='What is the server you want to put in Maintenance Mode?')]
    [Alias("Server")]
    [string[]]$ServerName,
    [Parameter(Mandatory=$True,
    ValueFromPipeline=$false,
    ValueFromPipelineByPropertyName=$True,
    HelpMessage='Specifies the time the maintenance will end. The minimum amount of time a resource can be in maintenance mode is 5 minutes. This is a required parameter. Format is 1/29/2014 8:59:26 AM')]
    [Datetime]$end,
    [Parameter(Mandatory=$False,
    ValueFromPipeline=$True,
    ValueFromPipelineByPropertyName=$True,
    HelpMessage='PlannedOther, UnplannedOther, PlannedHardwareMaintenance, UnplannedHardwareMaintenance, PlannedHardwareInstallation, UnplannedHardwareInstallation, PlannedOperatingSystemReconfiguration, UnplannedOperatingSystemReconfiguration, PlannedApplicationMaintenance, ApplicationInstallation, ApplicationUnresponsive, ApplicationUnstable, SecurityIssue, LossOfNetworkConnectivity')]
    [string]$Reason,
    [Parameter(Mandatory=$False,
    ValueFromPipeline=$True,
    ValueFromPipelineByPropertyName=$True,
    HelpMessage='Allows you to type a comment about the maintenance activity.')]
    [string]$Comment,
    [switch]$EventLog
    set-strictmode -version latest
    #$start=Get-Date
    #$currentlog = $start.ToString()
    Write-Verbose "Starting $($myinvocation.mycommand)"
    Write-Verbose "Ready to put ServerName $ServerName in Maintenance Mode"
    Function Start-SCOMMaintenanceModeForServer
    [CmdletBinding(SupportsShouldProcess=$true)]
    param
    [Parameter(Mandatory=$True,
    ValueFromPipeline=$True,
    ValueFromPipelineByPropertyName=$True,
    HelpMessage='What is the server you want to put in Maintenance Mode?')]
    [Alias("Server")]
    [string[]]$ServerName,
    [Parameter(Mandatory=$True,
    ValueFromPipeline=$false,
    ValueFromPipelineByPropertyName=$True,
    HelpMessage='Specifies the time the maintenance will end. The minimum amount of time a resource can be in maintenance mode is 5 minutes. This is a required parameter. Format is 1/29/2014 8:59:26 AM')]
    [Datetime]$end,
    [Parameter(Mandatory=$False,
    ValueFromPipeline=$True,
    ValueFromPipelineByPropertyName=$True,
    HelpMessage='PlannedOther, UnplannedOther, PlannedHardwareMaintenance, UnplannedHardwareMaintenance, PlannedHardwareInstallation, UnplannedHardwareInstallation, PlannedOperatingSystemReconfiguration, UnplannedOperatingSystemReconfiguration, PlannedApplicationMaintenance, ApplicationInstallation, ApplicationUnresponsive, ApplicationUnstable, SecurityIssue, LossOfNetworkConnectivity')]
    [string]$Reason,
    [Parameter(Mandatory=$False,
    ValueFromPipeline=$True,
    ValueFromPipelineByPropertyName=$True,
    HelpMessage='Allows you to type a comment about the maintenance activity.')]
    [string]$Comment,
    [switch]$EventLog
    Begin
    Write-Verbose "Starting Function Start-SCOMMaintenanceModeForServer"
    #Check for minumum Maintenance mode period of 5 mins.
    $start = Get-Date
    $5MinFromNowTime = $start.AddMinutes(5)
    #$end = [datetime]$end
    $end = $end.AddSeconds(5)
    if($end -lt $5MinFromNowTime)
    Write-Error "The time span for the maintenance mode should be at least 5 minutes." -ErrorAction Stop
    Write-Verbose "Following server will be put in Maintenance Mode: $ServerName"
    $MSs = Get-SCOMManagementServer
    } #End Begin
    Process
    Write-Verbose "Checking if server $ServerName is a Management Server"
    #Write-Verbose ($MSs | Select DisplayName)
    if(($MSs | Select DisplayName) -eq $ServerName)
    Write-Verbose "We don't want to put a Management Server in Maintenance Mode. Skipping"
    else
    Write-Verbose "Let's put server $ServerName in Maintenance Mode"
    $Instance = Get-SCOMClassInstance -Name $ServerName
    if ($PSCmdlet.ShouldProcess("Putting $ServerName in Maintenance Mode until $($end).") )
    Write-Verbose ("Start-SCOMMaintenanceMode -Instance " + $Instance + " -EndTime " + $end + " -Reason " + $Reason + " -Comment " + $Comment)
    Start-SCOMMaintenanceMode -Instance $Instance -end $end -Reason $Reason -Comment $Comment
    }#End of whatif
    }#End of else
    if ($PSBoundParameters['EventLog'])
    write-eventlog -LogName "Operations Manager" -Source "OpsMgr SDK Service" -EventID 999 -message "The following Objects are put into in Maintenance Mode until $($end) : $($ServerName)"
    }#End if
    } #End Process
    End
    Write-Verbose "Finished Function Start-SCOMMaintenanceModeForServer Function"
    #Main
    try
    if ($PSBoundParameters['EventLog'])
    write-eventlog -LogName "Operations Manager" -Source "OpsMgr SDK Service" -EventID 998 -message "The $($myinvocation.mycommand) is used to put Objects in Maintenance Mode"
    Write-Verbose "Checking if OperationsManager Module is loaded"
    #Check if OperationsManager Module is loaded.
    if(!(Get-Module OperationsManager))
    Write-Verbose "Importing OperationsManager Module"
    Import-Module OperationsManager -ErrorAction Stop
    Write-Verbose "Checking for OM2012 environment"
    #Check if OM2012 is being used.
    if(!(Get-Module OperationsManager).Description -eq "Operations Manager OperationsManagerV10 Module")
    Write-Error "This script is only for OM2012"
    #Call Function
    if ($PSBoundParameters['EventLog'])
    Start-SCOMMaintenanceModeForServer -ServerName $ServerName -end $end -Reason $Reason -Comment $Comment -EventLog
    else
    Start-SCOMMaintenanceModeForServer -ServerName $ServerName -end $end -Reason $Reason -Comment $Comment
    } #End Try
    catch [System.IO.FileNotFoundException]
    "OperationsManager Module not found"
    $_.Exception.Message
    catch
    Write-Warning "Oops something went wrong"
    $_.Exception.Message
    $end=Get-Date
    Write-Debug ("Total processing time {0}" -f ($end-$start).ToString())
    Write-Verbose "Ending $($myinvocation.mycommand)"
    There is one remaining problem with this script.   It does not correctly check to see if something is a management server. We have two management servers. These are the applicable lines, which I still haven't gotten to work yet. First, this retrieves
    the list of my Management servers:
    $MSs=Get-SCOMManagementServer     
    Next, these lines are supposed to check if the server I specified is a management server:
    if(($MSs | Select DisplayName) -eq $ServerName)
    Write-Verbose "We don't want to put a Management Server in Maintenance Mode. Skipping"
    Thanks to the Intellisense pop-up deal, I can see that $MSs does get my two management servers. And I can clearly see that there is a DisplayName column. And I can also see that the $ServerName does match what I put in my command line.   But it doesn't
    seem to catch them if they are actually equal to each other. I don't know if it's because there's two Management Servers, and it doesn't know how to compare like that? Any idea? Is there some sort of loop I need to write so that it compares is to the DisplayName
    for EACH Management Server it finds? Any help would be greatly appreciated.

  • Maintenance Mode Does not end

    We have an issue where MM never ends at the scheduled time. This just started happening about 2 days ago and we arent sure what caused it, but it looks like the stored procedures in SQL have stopped. So I'm looking for advice on how to start those back up.
    We have OpsMgr 2007 r2 on server 2008 r2. SQL is 2008. 
    Thanks!
    - Get on the floor, do that dinosaur

    I was able to fix it by going onto one of the other management servers and putting the RMS into MM and then taking it out. I guess that somehow kicked off the stored procedures to start running. 
    I know that a management server cannot take itself out of MM, but it didnt look like it was even in MM. It was till being monitored as far as I can tell, it was in a warning state... but whatever.
    - Get on the floor, do that dinosaur

  • SCOM 2012 - Use Powershell to put specific server and contained objects into Maintenance Mode

    I am still trying to develop what I thought was going to be an easy script, to put a specific server and all it's contained objects into maintenance mode in SCOM 2012.   Not a group, but just one specific server and all it's stuff.
    My script to START maintenance mode has two parameters:
    1.  The FQDN.  So for example: server1.contoso.com
    2.  The amount of minutes to put into maintenance mode
    Then it does the following to START maintenance mode:
    Import-Module OperationsManager
    $Instance = Get-SCOMClassInstance -Name $FQDN
    If ($Instance)
    $newEnd = ((Get-Date).AddMinutes($minutes))
    Start-SCOMMaintenanceMode -Instance $Instance -end $newEnd -Reason "PlannedOther" -Comment "Comments here"
    This seems to work from what I can tell.  I know that when you schedule maintenance mode manually in SCOM, there is an option to apply to "Selected objects and all their contained objects".  I do not know if that is occurring based on
    my code above.   But I think that is what I want to happen.   I just want all monitoring and alerting for the specified server to stop.   So if you think I need to change the above code so that it gets all the "contained
    objects" please let me know.
    The second part, which I know for a fact isn't fully working, is intended to stop maintenance mode for a server.
    My script to STOP maintenance mode has only one parameter:
    1.  The FQDN.  So for example: server1.contoso.com
    Then it does the following to STOP maintenance mode:
    Import-Module OperationsManager
    $Instance = Get-SCOMClassInstance -Name $FQDN
    If ($Instance)
    $MMEntry = Get-SCOMMaintenanceMode -Instance $Instance
    If ($MMentry)
    #basically sends an end time of 1 minute from when the script is run
    $newEnd = ((Get-Date).AddMinutes(1))
    Set-SCOMMaintenanceMode -MaintenanceModeEntry $MMEntry -EndTime $NewEnd -Comment "Removing from Maintenance Mode"
    This part does seem to work partially.   It does remove the server from maintenance mode.  However, I suspect that it's not removing all the "contained objects" from maintenance mode because when I run the script to stop maintenance
    mode on a server, the little maintenance mode icon in SCOM does go away but the overall light for the server stays set to "Not Monitored".   It never turns back to the green checkbox and says "Healthy".   When I start
    and stop maintenance mode manually I can see that the green Healthy checkbox comes back.  But when I try to run my above code to do it via script, it stays at "Not Monitored" instead.
    Can someone help me out here?  Looking for answers to two questions:
    1.  Does my Start maintenance mode code look ok? Will that put a server and all it's contained objects into maintenance mode?
    2.  What do I need to hadd to my Stop maintenance mode code, so that it correctly stops maintenance mode on the server and all its objects and everything starts to be monitored again?
    Thanks in advance!  Please let me know if you need any more information in order to be able to help me!

    Hello, thanks for your response.  Unfortunately, it does not appear that the link you provided works.
    As far as not including "selected objects and all their contained objects" I am wondering if there is a way for me to tell for sure. One thing I found was that if I run this script and put the server into maintenance mode, then I go into
    SCOM and click on Edit Maintenance Mode for that server, it shows me the details.   It has some comment, and my selected reason, based on the code I posted above.   It also DOES have "selected objects and all their contained objects"
    selected at top.  So it seems to me like it is working correctly, and does contain all the objects.   If you think that 'Edit' screen would be inaccurate for some reason, please let me know.  Or if you know of a way for me to check and
    confirm, please let me know that as well.
    As for REMOVING it from maintenance mode, I did eventually find a line of code that I think works.  Here's what my code looks like now:
    Import-Module OperationsManager
    $Instance = Get-SCOMClassInstance -Name $FQDN
    If ($Instance)
    $MMEntry = Get-SCOMMaintenanceMode -Instance $Instance If ($MMentry)
    $Instance.StopMaintenanceMode([DateTime]::Now.ToUniversalTime(),[Microsoft.EnterpriseManagement.Common.TraversalDepth]::Recursive);
    When I use the above code to STOP maintenance mode, the green checkmark does reappear for the server, and everything seems to be being monitored again.   Unlike before, where the maintenance mode icon would go away, but it would never change back
    to saying 'Monitored' again.  So I think that changing that one line to stop maintenance mode seems to have done the trick.
    So I guess my last concern now is just putting in maintenance mode initially, as I was talking about above.  If you still think the 'Edit Maintenance Mode' screen is not a good indicator of what my code does, please let me know.

  • Scheduling Operations Manager Maintenance mode?

    I'm trying to schedule Stephan Stranger's SCOM Maintenance mode script.  The issue is that I don't see a good way to pass the parameters the scripts
    is looking for via the Scheduled Task.
    Is there a good way to pass the scripts needed parameters like group name and maintenance mode duration?  Maybe I need to write a batch file and call the .ps1 and arguments from the .BAT - I've been playing with the .BAT for over an hour and can't that
    to work either.
    Currently when I create a scheduled task with these settings:
    Program/script:
    C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
    Add Aurguments (optional): 
    -noexit C:\Scripts\MaintMode\Start-SCOMMaintenanceModeForGroups.ps1 "TestingDSRGroup" -endtime 5 -reason "unplannedother" -comment "Testing DSR Group" -Verbose
    It seems to just run in the background with out popping up a powershell window and will eventually end with a (0x1) Last Run Result.
    Here is the syntax that works great from with in powershell with Stephan's script but I can't seem to work from a scheduled task:
    C:\Scripts\MaintMode\Start-SCOMMaintenanceModeForGroups.ps1 "Testing DSR Group" -endtime 5 -reason "unplannedother" -comment "Testing DSR Group" -Verbose
    Any assistance appreciated.

    Hi,
    An easy way around this is to use the -File parameter. Write up a quick oneliner that calls your script and save it as a .ps1 file. As soon as you have a working caller script, you can use -File C:\path\to\script.ps1 as the arguments and the scheduler will
    just run your script instead of trying to specify all of your parameters directly.
    Don't retire TechNet! -
    (Don't give up yet - 12,830+ strong and growing)
    Thanks Mike.  That did the trick.  I tried the -FILE argument previously with no luck, I should have mentioned that in my original post.  
    Once I created a .PS1 with the arguments I needed and then called that with the scheduled task it went off with out a hitch.  Thanks a milion.  I never would have thought of that.

  • Ipod boot never end...

    Hi all,
    I have a big prob with my ipod photo 40GB : I tried to use it in disk mode to backup my hard disk, and during the copy the ipod gave a unknow error. Since this the ipod start the boot (white apple on black background) and never end, the boot restart every 5-10 secondes... no ipod on dekstop so no way to reinstall it with ipod updater. I tried the 5R but it still the same... Please help !!!
    Thanks in advance
    Phil

    I am experiencing the identical problem. I am hoping that if I drain the battery until it is completely dead it may force a "hard" reset which when charged again, it may start working properly.
    Let me know if you find anything out.

  • Suddenly never ending pinwheel and slower than usual

    My macbook pro suddenly started to get slow and gave me a never ending pinwheel while only having Safari running. The mouse was working but no response when clicking. Only way to restart computer was by holding down the Start button. Restarted and this time the computer hang up when I tried to Log in (while writing Login and password). I mangaged to Log in two more times but I got the pinwheel again when browsing internet. Finally I managed to make it to Support/Community.. any idea what's wrong?
    Thanks in advance (: !

    Print out these instructions and info at the links provided as most require you to be offline.
    Do a SMC and PRAM reset first, then a Hardware Test
    https://support.apple.com/kb/ht3964
    http://docs.info.apple.com/article.html?path=Mac/10.6/en/26871.html
    https://support.apple.com/kb/ht1509
    If the hardware test gives any errors, note them here.
    Check the time and date on your computer to make sure it's correct.
    If your still having slowdowns, pull the power plug on both the router and the modem, connect the modem and wait a bit then connect the router. Reboot your computer and it should connect automatically to your wifi. See if your slowdowns only occur if connecteted to the WiFI or not, that way it can be determined if it's a internet issue or not.
    (If your still having slowdowns, it might be because you have a Open Network on your router and someone is leaching off of it. WPA 2 with AES is the only secure wifi standard))
    You can test your internet connection speed here, see if it matches what your paying for.
    http://www.speedtest.net/
    IF your computer still has issues then:
    Fish out the 10.6.x disks that came with your computer (grey) or the 10.6.3 Snow Leopard retail disk, stick it in the computer and reboot holding the c key.
    (Make sure the disks are clean on the bottom, wipe with a very soft cloth and a tiny bit of rubbing alcohol to clean and don't place the disk on a harsh surface that can damage the bottom.)
    Second screen in, under the Utilities menu is Disk Utility, select your drive on the left and click First Aid, Repair Disk (please write down any errors this gives and tell us) and Repair Permissions (the results there you can ignore)
    Do not erase or reformat the drive.
    Reboot and see if your computer works, if not repeat the c boot off the installer disk again and this time skip Disk Utility and install OS X.
    It will install on top of your 10.6.8 installed version (only, not your programs or files), which when finished you reboot and immediately Software Update to 10.6.8
    This should take care of anything wrong with OS X itself.
    Now to clean the caches of the user and other checks.
    Download the free OnyX for 10.6 and run ALL the maintenance and cleaning aspects and reboot at the end of the tasks (you can cancel in between reboots) but reboot at the end of using Onyx)
    Do all the checks it asks when it starts up and note any errors here they report.
    Also under the Verify Tab is a Preference (plist) check, check the "show only corrupt files" and run that, make a note of all and any corrupt plist files.
    http://www.titanium.free.fr/
    Plist files are preference settings files that sometimes get corrupted and may be the cause of your problems.
    If you have some, then you can look in your Users/Library/Preferences folder for them and Trash them and reboot the machine and load the program responsible, the plist file gets rebuilt without your preferences which you reset.
    The next thing to check would be your web browser plug-ins here
    https://www.mozilla.org/en-US/plugincheck/
    For Flash in Safari check here again as it's more accurate
    http://flashbuilder.eu/flash-player-version.html
    Download Flash and install if it's not this version (latest)
    http://get.adobe.com/flashplayer/
    Silverlight here
    https://www.microsoft.com/getsilverlight/get-started/install/default.aspx
    Finally install and run ClamXAv on your drive, this will look for known malware that might have gotten accidentally installed.
    http://www.clamxav.com/
    Since OS X was reinstalled, along with bundled programs like Safari, this should only leave applications and users as a source of any infection.
    If your stil having issues, then create a new user and transfer your files over and when up on the new user, delete it.

  • AdamSync from AD to LDS goes into a continuous never ending loop... can't figure this out.

    I THINK I've got this thing configured up to the point where it should be able to sync.  The XML config is set to just grab a single OU with roughly 12 accounts in it.
    Everything seems to connect OK, then it does a ton of "Processing Entry", even though there are only a few accounts in this OU.
    Then it begins to do "Adding target object..." and gets stuck in a never ending loop.
    Can someone point me in the right direction on how to troubleshoot this?
    This is what the log looks like:
    ==========================
    Adamsync.exe v1.0 (6)
    Establishing connection to target server localhost:6389.
    There is already an active sync session in progress. 
    Please allow the session to complete, or use -mai to seize the role.
    Saving Configuration File on CN=Test,DC=domain,DC=org
    Saved configuration file.
    ADAMSync is querying for a writeable replica of 10.10.10.10.
    Error: DCLocator call failed with error 1355. Attempting to bind directly to string.
    Establishing connection to source server 10.10.10.10:389.
    Using file .\dam9280.tmp as a store for deferred dn-references.
    Populating the schema cache
    Populating the well known objects cache
    Starting synchronization run from dc=domain,dc=org.
    Starting DirSync Search with object mode security.
    Processing Entry: Page 1, Frame 1, Entry 0, Count 0, USN 0
    Processing source entry <guid=94f6d930da2339439df75278a02accae>
    Previous entry took 0 seconds (0, 0) to process
    Processing Entry: Page 1, Frame 1, Entry 1, Count 1, USN 0
    Processing source entry <guid=bf15bc4b684ece4f99010548e79decb0>
    Previous entry took 0 seconds (0, 0) to process
    Processing Entry: Page 1, Frame 1, Entry 2, Count 1, USN 0
    Processing source entry <guid=fcea01637658134eab7ec74fe022d4fe>
    Previous entry took 0 seconds (0, 0) to process
    Processing Entry: Page 3, Frame 1, Entry 35, Count 1, USN 0
    Processing source entry <guid=5e768f4392863b4d86935e6bf01acc25>
    Previous entry took 0 seconds (0, 0) to process
    Processing Entry: Page 3, Frame 1, Entry 36, Count 1, USN 0
    Processing source entry <guid=b5d263a264aad045b8f42f19b49dd844>
    Previous entry took 0 seconds (16, 0) to process
    Processing Entry: Page 3, Frame 1, Entry 37, Count 1, USN 0
    Processing source entry <guid=f19994051c804846b7bcbd066d9e9d40>
    Previous entry took 0 seconds (0, 0) to process
    Processing Entry: Page 3, Frame 1, Entry 38, Count 1, USN 0
    Processing source entry <guid=b16cd765bafa4f4d8649d91f0f055e5f>
    Previous entry took 0 seconds (0, 0) to process
    Processing Entry: Page 3, Frame 1, Entry 39, Count 1, USN 0
    Processing source entry <guid=6be6a7d551978445aafd3803e60dc560>
    Processing in-scope entry 6be6a7d551978445aafd3803e60dc560.
    Adding target object CN=User Name,OU=Staff Accounts,OU=Users,OU=ITS,CN=Test,dc=domain,dc=org.
    Adding attributes: sourceobjectguid, instanceType, objectSid, sAMAccountName, lastagedchange, objectclass, 
    Adding target object CN=User Name,OU=Staff Accounts,OU=Users,OU=ITS,CN=Test,dc=domain,dc=org. Requesting replication of parent.
    Previous entry took 0 seconds (0, 0) to process
    Processing Entry: Page 3, Frame 2, Entry 0, Count 0, USN 53438354
    Processing source entry <guid=bbb4a760a8281741a11d9331efaa3d7a>
    Processing in-scope entry bbb4a760a8281741a11d9331efaa3d7a.
    Adding target object OU=Staff Accounts,OU=Users,OU=ITS,CN=Test,dc=domain,dc=org.
    Adding attributes: objectClass, instanceType, sourceobjectguid, lastagedchange, 
    Adding target object OU=Staff Accounts,OU=Users,OU=ITS,CN=Test,dc=domain,dc=org. Requesting replication of parent.
    Previous entry took 0 seconds (0, 0) to process
    Processing Entry: Page 3, Frame 3, Entry 0, Count 0, USN 52660067
    Processing source entry <guid=8d3ef319dff31f47819632af2da5df2c>
    Previous entry took 0 seconds (0, 0) to process
    Processing Entry: Page 3, Frame 2, Entry 0, Count 0, USN 53438354
    Processing source entry <guid=bbb4a760a8281741a11d9331efaa3d7a>
    Processing in-scope entry bbb4a760a8281741a11d9331efaa3d7a.
    Adding target object OU=Staff Accounts,OU=Users,OU=ITS,CN=Test,dc=domain,dc=org.
    Adding attributes: objectClass, instanceType, sourceobjectguid, lastagedchange, 
    Adding target object OU=Staff Accounts,OU=Users,OU=ITS,CN=Test,dc=domain,dc=org. Requesting replication of parent.
    Previous entry took 0 seconds (0, 0) to process
    Processing Entry: Page 3, Frame 3, Entry 0, Count 0, USN 52660067
    Processing source entry <guid=8d3ef319dff31f47819632af2da5df2c>
    Previous entry took 0 seconds (0, 0) to process
    ===================================================

    Hi,
    Are there any error messages from the event log?
    Here is a KB article which describes a similar issue below I suggest you refer to:
    Error message when you use the Adamsync tool in Windows Server 2003: "Error: We seem to be in an infinite recursive loop"
    http://support2.microsoft.com/kb/926933
    Best Regards,
    Amy

  • A never ending loop...not sure why?

    When I run my current procedure, it seems to be getting caught in a never ending loop, not entirley sure what the problem is...? I'm not quite the expert so if possible, the more detail in the explaniation the better...thanks!!
    --The cursors
    cursor konami_mlb_pitchers_crsr is
       select player_id_1032
       from customer_data.cd_baseball_pit_ytd_stats
       where split_number = -3
         and game_type_id = 1
         and sequence = 0
         and season_id = iSeasonID
       order by player_id_1032;
    cursor konami_mlb_career_pit_crsr is
       select ytd.player_id_1032,
          ytd.player_id,
          ytd.moniker,
          ytd.last_name,
          sum(ytd.games_played),
          trunc(sum(ytd.outs_pitched) / 3) || '.' || mod(sum(ytd.outs_pitched), 3) as innings_pitched,
          sum(ytd.complete_games),
          sum(ytd.shut_outs),
          sum(ytd.wins),
          sum(ytd.losses),
          to_char((sum(ytd.wins)) / decode(sum(ytd.wins) + sum(ytd.losses), 0, 1, null, 1, sum(ytd.wins) + sum(ytd.losses)), '0d000') as winning_pct,
          trim(to_char( (9 * sum(ytd.earned_runs)) / (sum(ytd.outs_pitched) / 3) , '990d00')) as era,
          sum(ytd.strikeouts),
          sum(ytd.saves),
          sum(ytd.hits),
          sum(ytd.home_runs),
          sum(ytd.walks),
          sum(ytd.hit_batters),
          sum(ytd.earned_runs),
          sum(ytd.runs)
       from customer_data.cd_baseball_pit_ytd_stats ytd,  customer_data.cd_baseball_roster rost
       where ytd.split_number = -3
         and ytd.game_type_id = 1
         and ytd.sequence = 0
         and rost.player_id = ytd.player_id
         and rost.league_id = iLeagueID
         and ytd.season_id <= iSeasonId   
         and ytd.active_record != 'R'
         and ytd.player_id_1032 in
        --Includes Players that were on the DL for the entire season                                          
          select player_id_1032
         from customer_data.cd_baseball_roster r
         where r.year_last = 2008
         and r.league_id = iLeagueID
         and r.player_id_1032 is not NULL
         group by ytd.player_id_1032,ytd.player_id, ytd.moniker,  ytd.last_name;   --Where the cursor gets opened
    open konami_mlb_pitchers_crsr;
       loop
          fetch konami_mlb_pitchers_crsr into pitcher;
          exit when konami_mlb_pitchers_crsr%notfound;
          open konami_mlb_career_pit_crsr;
          loop
             fetch konami_mlb_career_pit_crsr into pitcher_record;
             exit when konami_mlb_career_pit_crsr%notfound;
             utl_file.put_line(file_handle, pitcher_record.first_name || ',' ||
                                            pitcher_record.last_name || ',' ||
                                            pitcher_record.id || ',' ||
                                            pitcher_record.games_played || ',' ||
                                            pitcher_record.innings_pitched || ',' ||
                                            pitcher_record.complete_games || ',' ||
                                            pitcher_record.shutouts || ',' ||
                                            pitcher_record.wins || ',' ||
                                            pitcher_record.losses || ',' ||
                                            pitcher_record.winning_pct || ',' ||
                                            pitcher_record.era || ',' ||
                                            pitcher_record.strikeouts || ',' ||
                                            pitcher_record.saves || ',' ||
                                            pitcher_record.hits || ',' ||
                                            pitcher_record.homeruns || ',' ||
                                            pitcher_record.walks || ',' ||
                                            pitcher_record.hit_batters || ',' ||
                                            pitcher_record.earned_runs || ',' ||
                                            pitcher_record.runs);
          end loop; -- end loop through the stats for each pitcher
          close konami_mlb_career_pit_crsr;
       end loop; -- end loop through all the pitchers
       close konami_mlb_pitchers_crsr;

    You don't seem to be using the cursor iterator variable "pitcher" when you print the data to the file. You are not even passing any parameter to the "konami_mlb_career_pit_crsr" cursor. As such the first cursor "konami_mlb_pitchers_crsr" appears to be redundant.
    Maybe the loop is time-consuming (instead of "never-ending"), and if you wait long enough, it will end. In the meantime, you may want to tune your logic.
    isotope

  • Put servers in Maintenance Mode in SCOM 2012

    Hi,
    When we put a server in maintenance mode in SCOM 2012 it asks for only the end time. How can we specify the start time for maintenance mode.
    Thanks

    You can specify the start time for maintenance mode by schedule Maintenance mode.
    For how to create schedule for maintenance mode, you can refer below link
    http://support.microsoft.com/kb/2704170/en-us
    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question, please click "Mark As Answer"
    Mai Ali | My blog: Technical

  • Exchange 2013 server stuck in maintenance mode.

    Hello,
    I have a single server setup for Exchange 2013 and recently had an issue with Maintenance mode during updates. I was in the process of getting the server upgraded to SP1 when it happened. I had tried to run the service pack when it returned an error
    saying something was pending and it couldn't install. Because the server had several windows updates and 1 Exchange 2013 security update downloaded from wsus, I thought it was obviously this. So I cancelled out of the sp1 install and ran the updates.
    Once the updates were finished and the server rebooted, mail wouldn't flow. Found out it was because it was in Maintenance mode.
    I'm not sure if it was the SP1 install or the security update that placed the server in this mode, but it seemed like it was the security update(KB2880833.) From what I've found on the interwebs, Maintenance mode is meant for High Availability setups, which
    mine is not and it has to be put into that mode mannually. I never put the server into this mode. Is this done automatically by running updates or Service packs? and if so, how can I turn prevent it from happening automatically? Is it necessary? I have
    no reason to use it, as we only have one server. I've found plenty of info on how to turn it on or off, but nothing about any automatic settings.
    THanks for any guidance.

    Hi,
    When a CU or SP is installed, the server is automatically put in maintenance and I don't think there is a way to stop that. It is written to the
    ExchangeSetup.log and will look like this:
    Set-ServerComponentState $Target -Component Monitoring -Requester Functional -State Inactive
    Set-ServerComponentState $Target -Component RecoveryActionsEnabled -Requester Functional -State Inactive
    Set-ServerComponentState $Target -Component ServerWideOffline -Requester Functional -State InActive
    If the CU or SP runs successfully, it will be taken out of maintenance mode automatically with the below commands but if a failure occurs, it can be done manually with:
    Set-ServerComponentState SERVERNAME -Component Monitoring -Requester Functional -State Active
    Set-ServerComponentState SERVERNAME -Component RecoveryActionsEnabled -Requester Functional -State Active
    Set-ServerComponentState SERVERNAME -Component ServerWideOffline -Requester Functional -State Active
    Martina Miskovic

  • Maintenance mode disapeared

    Hello,
    I am using SCOM 2012 R2 and the problem is that, if I put an agent in a maintenance mode for more than 24 hours using the specific end time duration. the maintenance mode will disapear automaticaly after some hours !!!
    How can I solve this problem ??
    Regards,
    SAM 

    Usually, agent machine will not exist maintenance mode until it reach its scheduled end time.
    1) Is it a particula issue?
    2) not put managmemt server in maintenance mode
    3) put a problematic sever in MM and run powersehll cmdlet get-scommaintenance to see its scheduledendtime is correct
    4) If problem exist, check wheher any script or monitor recovery task which  will force agent exits MM
    Roger

  • Maintenance mode related

    Hello,
    how to identify whether the application is in maintenance mode or not ?
    Like 1) in front end we wll get the message that application is in maintenance mode? thats it? or anyother way to know?Kindly tell me.
    Thanks,
    928714.

    You can manually change maintenance mode without using adadmin :
    Run using apps user :
    This is for enable the maintenance mode
    @$AD_TOP/patch/115/sql/adsetmmd.sql ENABLE
    This is for disable the maintenance mode
    @$AD_TOP/patch/115/sql/adsetmmd.sql DISABLE
    You can check the current maintenance mode status using below sql :
    select decode(fnd_profile.value('APPS_MAINTENANCE_MODE'),'MAINT','Maintenance Mode is Enabled','NORMAL','Maintenance Mode is Disabled') "Mode" from dual;
    Thanks,
    Sumedh

  • Automatic Maintenance Mode SCOM 2012

    What I'm trying to do is get an alert based on a shutdown event to trigger a script that then puts the server into maintenance mode.  I've seen a few solutions to this for 2007, but this is the only one I've seen for 2012. 
    https://overcast.azurewebsites.net/2013/11/auto-maintenance-mode-with-scom-2012/
    Basically, an alert is set up to watch for the shutdown event, which then uses a command channel to execute the script.  The main significant part of that is the use of the ManagedEntityDisplayName parameter in the command channel to pass the server
    name to the script.  If I run the script from a command prompt and pass the FQDN of the server to it as a parameter, it works like a charm.  But when I use SCOM to run it through the command channel, the server never gets put into
    mm.  For troubleshooting, I had it write a couple things to a log file. 
    When I run it from the command prompt, the log file contains the hostname I'm passing it for the ManagedEntity parameter in line 4, and the Instance that is returned from line 6 and it all works.
    When I run it with the command channel in SCOM, it again writes out the ManagedEntity parameter as the hostname, so that part seems to work the same.  But the Instance is returned to the log file as an empty line and then of course the server doesn't
    go into MM.  So it seems like something is different between me passing the FQDN as a parameter from the command line, and the command channel passing the ManagedEntity parameter from SCOM.  Even though they both get written to the log file as the
    hostname of the server.  Any idea what I'm missing?
    Param($ManagedEntityDisplayName)
    $startTime = [DateTime]::Now
    $endTime = $startTime.AddMinutes(15)
    "Managed Entity is $managedentitydisplayname" |out-file log.txt
    import-module OperationsManager
    $Instance = Get-SCOMClassInstance -Name $ManagedEntityDisplayName
    "Instance is $Instance" | Out-File log.txt -Append
    Start-SCOMMaintenanceMode -Instance $Instance -EndTime $endTime

    Hi 
    What version of Power shell are you using on your management server? The I suspect the issue might be that when you run it doesn't actually load "import-module
    OperationsManager" when scom runs it. So when you execute any scom command and save it into a variable it will always be empty.
    To test if this is the issue run this
    Param($ManagedEntityDisplayName)
    $startTime = [DateTime]::Now
    $endTime = $startTime.AddMinutes(15)
    "Managed Entity is $managedentitydisplayname" |out-file log.txt
    import-module OperationsManager
    $SCOMConnection = Get-SCOMManagementGroupConnection
    "Connection is $SCOMConnection" | Out-File log.txt -Append
    $SCOMAgent = Get-SCOMAgent -name $ManagedEntityDisplayName
    "SCOMAgent is $SCOMAgent" | Out-File log.txt -Append
    If you don't get anything for these variables looks like the Import module is the issue.
    I suggest the following:
    Adding the full file path location to the module (might just not be registered correctly)
    see: http://msdn.microsoft.com/en-us/library/dd878350(v=vs.85).aspx
    If the above doesn't fix the issue re installing the console might be needed
    see: http://thoughtsonopsmgr.blogspot.com.au/2013/02/om12-sp1-operations-manager-shell-fails.html
    What version of Power shell are you also running on your Management server/s? If you are running v4 you might also need to include credentials when making a connection to the management server:
    see: http://blogs.technet.com/b/robcost/archive/2008/05/01/powershell-tip-storing-and-using-password-credentials.aspx
    So your after you import the Operations manager module you need
    New-SCOMManagementGroupConnection -ComputerName "localhost" -Credential (Get-Credential WOODGROVE\Administrator)
    see: http://technet.microsoft.com/en-us/library/hh920188(v=sc.20).aspx
    Also how many management servers do you have? If you have more that 1 don't forget to place a copy of the script in the same location on each MS.
    Thanks Martin
    sustaslog.wordpress.com

  • Error while enabling maintenance mode

    Hi,
    while enabling maintenance mode, the following error arises
    sqlplus -s &un_apps/***** @/d01/oracle/visappl/ad/11.5.0/patch/115/sql/adsetmmd.sql ENABLE
    An error occured while running adsetmmd.sql.
    Continue as if it were successfull [No] :
    charan

    [oracle@oraapps VIS_oraapps]$ sqlplus system/manager @$ORACLE_HOME/rdbms/admin/utlrp.sql
    SQL*Plus: Release 8.0.6.0.0 - Production on Wed Mar 19 08:15:06 2008
    (c) Copyright 1999 Oracle Corporation. All rights reserved.
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.6.0 - Production
    unknown SET option beginning "SQLPLUSCOM..."
    PL/SQL procedure successfully completed.
    Table created.
    Table created.
    Table created.
    Index created.
    Table created.
    Table created.
    SELECT o.obj#, o.type#, o.owner# FROM obj$ o
    ERROR at line 2:
    ORA-00942: table or view does not exist
    SELECT o.obj#, o.type#, u.name AS owner FROM utl_recomp_all_inv o, user$ u
    ERROR at line 2:
    ORA-00942: table or view does not exist
    Package created.
    No errors.
    Warning: Package Body created with compilation errors.
    Errors for PACKAGE BODY UTL_RECOMP:
    LINE/COL ERROR
    60/10 PL/SQL: SQL Statement ignored
    61/29 PL/SQL: ORA-00942: table or view does not exist
    64/10 PL/SQL: SQL Statement ignored
    64/17 PL/SQL: ORA-00942: table or view does not exist
    104/7 PL/SQL: SQL Statement ignored
    104/14 PL/SQL: ORA-00942: table or view does not exist
    183/13 PL/SQL: SQL Statement ignored
    184/35 PL/SQL: ORA-00942: table or view does not exist
    188/13 PL/SQL: SQL Statement ignored
    189/35 PL/SQL: ORA-00942: table or view does not exist
    196/13 PL/SQL: SQL Statement ignored
    LINE/COL ERROR
    197/35 PL/SQL: ORA-00942: table or view does not exist
    202/13 PL/SQL: SQL Statement ignored
    203/35 PL/SQL: ORA-00942: table or view does not exist
    267/10 PL/SQL: SQL Statement ignored
    268/42 PL/SQL: ORA-00942: table or view does not exist
    361/10 PL/SQL: SQL Statement ignored
    420/15 PL/SQL: ORA-00942: table or view does not exist
    538/11 PL/SQL: SQL Statement ignored
    539/19 PL/SQL: ORA-00942: table or view does not exist
    BEGIN utl_recomp.recomp_serial(); END;
    ERROR at line 1:
    ORA-04068: existing state of packages has been discarded
    ORA-04063: package body "SYSTEM.UTL_RECOMP" has errors
    ORA-06508: PL/SQL: could not find program unit being called
    ORA-06512: at line 1
    DECLARE
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00201: identifier 'DBMS_REGISTRY_SYS.VALIDATE_COMPONENTS' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    ORA-06512: at line 8
    =======================================
    [oracle@oraapps VIS_oraapps]$ sqlplus system/manager
    SQL*Plus: Release 8.0.6.0.0 - Production on Wed Mar 19 08:17:49 2008
    (c) Copyright 1999 Oracle Corporation. All rights reserved.
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.6.0 - Production
    unknown SET option beginning "SQLPLUSCOM..."
    SQL> @/d01/oracle/visappl/fnd/11.5.0/patch/115/sql/AFCORLGS.pls
    DOC> | Copyright (c) 2005 Oracle USA, Inc., Redwood Shores, California, USA |
    DOC> | All rights reserved. |
    DOC> +=======================================================================+
    DOC> | FILENAME
    DOC> | AFCORLGS.pls
    DOC> |
    DOC> | DESCRIPTION
    DOC> | PL/SQL specification for package: FND_CORE_LOG
    DOC> |
    DOC> | Core Logging Diagnostic Tool
    DOC> |
    DOC> |
    DOC> | HISTORY
    DOC> | 03/22/2005 PDELUNA Created
    DOC> |
    DOC> *=======================================================================*/
    Package created.
    Commit complete.
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.6.0 - Production
    [oracle@oraapps VIS_oraapps]$ sqlplus system/manager
    SQL*Plus: Release 8.0.6.0.0 - Production on Wed Mar 19 08:19:49 2008
    (c) Copyright 1999 Oracle Corporation. All rights reserved.
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.6.0 - Production
    unknown SET option beginning "SQLPLUSCOM..."
    SQL> @/d01/oracle/visappl/fnd/11.5.0/patch/115/sql/AFCORLGB.pls
    DOC> | Copyright (c) 2005 Oracle USA, Inc., Redwood Shores, California, USA |
    DOC> | All rights reserved. |
    DOC> +=======================================================================+
    DOC> | FILENAME
    DOC> | AFCORLGB.pls
    DOC> |
    DOC> | DESCRIPTION
    DOC> | PL/SQL body for package: FND_CORE_LOG
    DOC> |
    DOC> | Core Logging Diagnostic Tool
    DOC> |
    DOC> |
    DOC> | HISTORY
    DOC> | 03/22/2005 PDELUNA Created
    DOC> |
    DOC> *=======================================================================*/
    Warning: Package Body created with compilation errors.
    Commit complete.
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.6.0 - Production
    [oracle@oraapps VIS_oraapps]$ sqlplus system/manager
    SQL*Plus: Release 8.0.6.0.0 - Production on Wed Mar 19 08:20:21 2008
    (c) Copyright 1999 Oracle Corporation. All rights reserved.
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.6.0 - Production
    unknown SET option beginning "SQLPLUSCOM..."
    SQL> @/d01/oracle/visappl/fnd/11.5.0/patch/115/sql/AFPFPROB.pls
    DOC> | Copyright (c) 1993 Oracle Corporation Redwood Shores, California, USA |
    DOC> | All rights reserved. |
    DOC> +===========================================================================+
    DOC> | FILENAME
    DOC> | AFPFPROB.pls
    DOC> |
    DOC> | DESCRIPTION
    DOC> | PL/SQL body for package: FND_PROFILE
    DOC> |
    DOC> | Maintains the server side cache of profile options.
    DOC> |
    DOC> | NOTES
    DOC> | This module is called by AutoInstall (afprof.drv) on install and
    DOC> | upgrade. The WHENEVER SQLERROR and EXIT (at bottom) are required.
    DOC> |
    DOC> | HISTORY
    DOC> | 3/23/93 T Morrow Created
    DOC> | 5/27/93 G Buzsaki Updated to 10.X spec
    DOC> | 8/25/93 G Buzsaki Added GET_ANY procedure
    DOC> | 2/17/94 S Stratton Added security profiles to initialize
    DOC> | 4/30/96 T Morrow Added SAVE and SAVE_USER procedures.
    DOC> | 03/20/99 S Sung Replaced != with <>
    DOC> | 09/18/00 R Tse Added GET_TABLE_VALUE and
    DOC> | GET_ALL_TABLE_VALUES functions.
    DOC> | 01/03/01 J Cordes Rewrote get_specific() to minimize
    DOC> | logical reads. (Bug 1563556)
    DOC> | 05/08/01 G Khoury Rewrote find, put, get, get_all_table_values
    DOC> | to implement hash_table for caching of
    DOC> | fnd_profile_option_values. (Bug 1663264)
    DOC> | 11/13/01 R Tse Implemented multiple caches for storing
    DOC> | profile values at the 4 different levels.
    DOC> *===========================================================================*/
    Warning: Package Body created with compilation errors.
    Commit complete.
    Input truncated to 6 characters
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.6.0 - Production
    [oracle@oraapps VIS_oraapps]$

Maybe you are looking for