Yay so I finished my script and because Meredith Shirrell called - TopicsExpress



          

Yay so I finished my script and because Meredith Shirrell called me out on not giving her public credit when most of this was her idea... Also because Im terrified of her being anywhere near a powershell script. Plus She seemed sad so maybe this will make her laugh for like 10 seconds. All of the variables that could indentify anything have been removed, but the comment fields are very real. Yes there is a reason Im creating variables like that. # Get list of non active VMS to reboot cause Meredith Sez if I reboot her vm while shes working she will beat some sense into me. $Shoes = get-brokerdesktop Get-BrokerDesktop -SummaryState available | where {$_.DNSname -like *They will not let me name stuff after muppet babies or transformers*} # Dumps record of all vms to be rebooted to C: $shoes | export-csv C:\rebootrecordfri # yay I made a reboot! get-brokerdesktop -SummaryState available | where {$_.DNSname -like *They will not let me name stuff after muppet babies or transformers*} | new-brokerpoweraction restart # returns list of all the people that didnt listen to the all knowing XenDesktop administrator and log off... Bad users. $moonboots = get-brokerdesktop Get-BrokerDesktop -SummaryState disconnected | where {$_.DNSname -like *They will not let me name stuff after muppet babies or transformers*} # dumps list of active user sessions during Friday script run to csv file. $moonboots | export-csv C:\nonrebootfri # Now lets send people email reports they will never actually look at yay!!!! write-Host Sending Email #SMTP server $smtpServer = getyourownmailserver #Creating a Mail object $msg = new-object Net.Mail.MailMessage #Creating SMTP server object $smtp = new-object Net.Mail.SmtpClient($smtpServer) $file = C:\C:\nonrebootfri $att = new-object Net.Mail.Attachment($file) #Email structure $msg.From = $msg.ReplyTo = [email protected] $msg.To.Add([email protected]) $msg.subject = Friday night non complicance $msg.Body = Does it bother anyone else that this fool thinks I have an Orange deep fryer on my desk? Yet hes in charge of my entire virtual computing expierence? $msg.Attachments.Add($att) #Sending email $smtp.Send($msg)
Posted on: Sat, 19 Oct 2013 00:42:43 +0000

Trending Topics



Recently Viewed Topics




© 2015