Avatar of Netanel Elhadad
Netanel Elhadad

asked on 

reset pc script

Greetings,
I have a question, how can I use the following script to take the name of my selected computer and restart it?

$pc = Get-ADComputer -Filter * -Property CN | Select-Object CN |
Out-GridView -OutputMode Single -Title 'Select PC To Reset'
Restart-Computer -ComputerName ""
2018-08-30_10-14-46.png
2018-08-30_10-14-51.png
2018-08-30_10-14-54.png
PowershellVB ScriptPC

Avatar of undefined
Last Comment
Netanel Elhadad
ASKER CERTIFIED SOLUTION
Avatar of Jose Gabriel Ortega Castro
Jose Gabriel Ortega Castro
Flag of Venezuela, Bolivarian Republic of image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Netanel Elhadad
Netanel Elhadad

ASKER

Thanks a lot, it works.
I added the option of "-Force"
All good.
VB Script
VB Script

VBScript (Visual Basic Scripting Edition) is an interpreted scripting language developed by Microsoft that is modeled on Visual Basic, but with some important differences. VBScript is commonly used for automating administrative and other tasks in Windows operating systems (by means of the Windows Script Host) and for server-side scripting in ASP web applications. It is also used for client-side scripting in Internet Explorer, specifically in intranet web applications.

39K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo