Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Community Member

PowerShell and Tidal

I'm looking to get Multiple Windows server rebooted using PowerShell script in Tidal. Does anyone know how to use global variable using multiple servers. ?? Any Help would be appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Member

PowerShell and Tidal

Sounds like you are looking to do some automation surrounding microsoft patching or something like that.

I would not go about it with a global variable... I think there may be a character limitation on a var value.

Powershell is pretty powerfull and can easily do the task, you can get as fancy as you want...  Tidal can take mulitple powershell

statements. We often do this and leverage exit codes for different scenarios. using multiple ifs.

if (condition met) {Do this}  else {Do Else} ; Exit(###);

Then Tidal takes action based on exit code (alert, send email, etc)

From a Tidal/Powershell perspective you need to consider a few things

Security ... the runtime user needs access to all servers in the list in order to execute a shutdown or you pass it credentials. 

Tidal Agent config

Powershell commands can have issues with double quotes in params depending on how its used... so we avoid and each agent tagent.ini has this config switch

[config]

substticks=n

Target Servers may need same version of powershell as agents and have their execution policys set properly (depending on technique used)

Active Directory you may be organized to take advantage of server names

Workflow/Design
AD

You could have Tidal Powershell get a list from AD, generate a list, then reboot for each object..

List

Another Simple way would be to use powershell to determine the list based on critera or supply it a list. The simple way is something like this

restart-computer (get-content \\SomeNetworkShare\MS_PatchWeekend_ServerReboot_List.txt) ;

Tidal Groups with Group variables

Ad-Hoc

Maybe you want to be able to reboot servers ad-hoc so you could create a template that takes a group variable and passes that server name to the powershell restart-computer cmdlet.

Patch Weekend job group

Depending on size of the environment you could have a job set that is "scheduled" on patch weekends that is made up of mulitple template groups that leverage job name to pass server name to the powershell restart-computer cmdlet (jobname=servername). You could also have some sort of secondary powershell statement or second job that lets you know when server is back up...

Other

Here's a case where it finds servers to reboot and there are many examples on the internet to borrow and learn from.

http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/20/use-powershell-to-find-servers-that-need-a-reboot.aspx

Hope this helps!

Marc

2 REPLIES
Community Member

PowerShell and Tidal

Sounds like you are looking to do some automation surrounding microsoft patching or something like that.

I would not go about it with a global variable... I think there may be a character limitation on a var value.

Powershell is pretty powerfull and can easily do the task, you can get as fancy as you want...  Tidal can take mulitple powershell

statements. We often do this and leverage exit codes for different scenarios. using multiple ifs.

if (condition met) {Do this}  else {Do Else} ; Exit(###);

Then Tidal takes action based on exit code (alert, send email, etc)

From a Tidal/Powershell perspective you need to consider a few things

Security ... the runtime user needs access to all servers in the list in order to execute a shutdown or you pass it credentials. 

Tidal Agent config

Powershell commands can have issues with double quotes in params depending on how its used... so we avoid and each agent tagent.ini has this config switch

[config]

substticks=n

Target Servers may need same version of powershell as agents and have their execution policys set properly (depending on technique used)

Active Directory you may be organized to take advantage of server names

Workflow/Design
AD

You could have Tidal Powershell get a list from AD, generate a list, then reboot for each object..

List

Another Simple way would be to use powershell to determine the list based on critera or supply it a list. The simple way is something like this

restart-computer (get-content \\SomeNetworkShare\MS_PatchWeekend_ServerReboot_List.txt) ;

Tidal Groups with Group variables

Ad-Hoc

Maybe you want to be able to reboot servers ad-hoc so you could create a template that takes a group variable and passes that server name to the powershell restart-computer cmdlet.

Patch Weekend job group

Depending on size of the environment you could have a job set that is "scheduled" on patch weekends that is made up of mulitple template groups that leverage job name to pass server name to the powershell restart-computer cmdlet (jobname=servername). You could also have some sort of secondary powershell statement or second job that lets you know when server is back up...

Other

Here's a case where it finds servers to reboot and there are many examples on the internet to borrow and learn from.

http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/20/use-powershell-to-find-servers-that-need-a-reboot.aspx

Hope this helps!

Marc

Community Member

PowerShell and Tidal

Thanks Marc.

566
Views
0
Helpful
2
Replies
CreatePlease to create content