Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


anne
  •  anne
  • No customer Topic Starter
2013-10-18T15:59:54Z
Hey all,

So I'm trying to create a job that restarts all computers within an AD OU. We have tried doing it using "Get AD Group Members" but want to make something more automated, in case we forget to add a computer to the security group.

Is there a way to get all computers from an OU (or possibly multiple OUs) and then have a loop that runs a restart command on them?
Sponsor
Forum information
Support
2013-10-21T07:16:19Z
If that Task does not return what you want maybe the easiest way is to create some lines in .NET and run in the .NET code Task. Then you can loop through the list of the result from that Task and restart them.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
keithdavis
2014-08-06T12:52:13Z
Did you ever figure this out? We want to do the same thing. We tried to do this with PowerShell, but can't get it to work.
keithdavis
2014-08-06T15:54:40Z
I get this:

ExecuteProcess("C:\Program Files\VisualCron\\TaskPowerShell.exe" 15498)->System.Management.Automation.CommandNotFoundException: The term 'Get-ADComputer' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
at System.Management.Automation.Runspaces.Pipeline.Invoke()
at TaskPowerShell.PowerShellTaskClass.Run(ProcessPowerShellTaskInfoClass ti, StringBuilder& sbResultObject)
Exception in Task: ExecuteProcess("C:\Program Files\VisualCron\\TaskPowerShell.exe" 15498)->System.Management.Automation.CommandNotFoundException: The term 'Get-ADComputer' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
at System.Management.Automation.Runspaces.Pipeline.Invoke()
at TaskPowerShell.PowerShellTaskClass.Run(ProcessPowerShellTaskInfoClass ti, StringBuilder& sbResultObject)
Support
2014-08-07T18:02:52Z
http://stackoverflow.com...-as-the-name-of-a-cmdlet 

Originally Posted by: keithdavis 

I get this:

ExecuteProcess("C:\Program Files\VisualCron\\TaskPowerShell.exe" 15498)->System.Management.Automation.CommandNotFoundException: The term 'Get-ADComputer' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
at System.Management.Automation.Runspaces.Pipeline.Invoke()
at TaskPowerShell.PowerShellTaskClass.Run(ProcessPowerShellTaskInfoClass ti, StringBuilder& sbResultObject)
Exception in Task: ExecuteProcess("C:\Program Files\VisualCron\\TaskPowerShell.exe" 15498)->System.Management.Automation.CommandNotFoundException: The term 'Get-ADComputer' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
at System.Management.Automation.Runspaces.Pipeline.Invoke()
at TaskPowerShell.PowerShellTaskClass.Run(ProcessPowerShellTaskInfoClass ti, StringBuilder& sbResultObject)




Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
keithdavis
2014-08-07T18:04:27Z
Yea, that's I was afraid of. This is a Server 2003 machine.
Scroll to Top