Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- Gui, Add, Edit, x36 y26 w140 h310 vMyEdit
- Gui, Add, Button, x196 y56 w100 h80 , DisableComputers
- Gui, Show, w319 h374, Untitled GUI
- return
- GuiClose:
- ExitApp
- ButtonDisableComputers:
- Gui, Submit, NoHide
- Loop, Parse, MyEdit, `n
- {
- Line%A_Index% = %A_LoopField% ; Put it into Line%A_Index% ( Line1, Line2, Line3, Line4 etc.)
- psScript = %psScript% get-adcomputer %A_LoopField% | Set-ADComputer -Description "Disabled%A_MM%.%A_DD%.%A_YYYY%" -Enabled $false `n
- psScript = %psScript% get-adcomputer %A_LoopField% | Move-ADObject -TargetPath 'OU=Computers - Disabled,DC=example,DC=com' `n
- }
- psScript = %psScript% Read-Host -Prompt "PressEnterToContinue" `n
- MsgBox %psScript%
- RunWait, powershell.exe %psScript%
- psScript := ""
- GuiControl,, MyEdit,
- return
Advertisement
Add Comment
Please, Sign In to add comment