Need to get Maintenance Mode End time
Hello All, Get-MaintenanceWindow -monitoringobject:$Computer | select-object ScheduledEndTime The above command-let gives the below output. ScheduledEndTime ---------------- 10/7/2010 5:00:00 PM I want only the date & time part without the heading ScheduledEndTime. ---------------- Is there any way other than performing string operations to get it? I want this to develop the powershell script that put server in maintenance mode. It should check if the server is in maintenance mode, if it is then the previously set end time should be compared with the currently needed endtime and act accordingly. Do anyone have the powershell script that does the above stuff? Thanks & Regards, Dinesh Sundaram
October 7th, 2010 7:40pm

You can hide the headers by using Format-table -hidetableheaders or ft -hidetableheaders. Get-MaintenanceWindow -monitoringobject:$Computer | ft ScheduledEndTime -hidetableheaders -- Regards, Vik Singh -------------------------------------------------------------------------------- Please remember to click ??Mark as Answer? on the post that helps you, and to click ??Unmark as Answer? if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. "Dinesh Sundaram" wrote in message news:de2988f8-a0c4-4cfa-b49a-9a661319e347@communitybridge.codeplex.com... Hello All, Get-MaintenanceWindow -monitoringobject:$Computer | select-object ScheduledEndTime The above command-let gives the below output. ScheduledEndTime ---------------- 10/7/2010 5:00:00 PM I want only the date & time part without the heading ScheduledEndTime. ---------------- Is there any way other than performing string operations to get it? I want this to develop the powershell script that put server in maintenance mode. It should check if the server is in maintenance mode, if it is then the previously set end time should be compared with the currently needed endtime and act accordingly. Do anyone have the powershell script that does the above stuff? Thanks & Regards, Dinesh Sundaram
Free Windows Admin Tool Kit Click here and download it now
October 7th, 2010 11:56pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics