Basic Power shell commands with System center products
Power Shell Scripts for System Center (Master Collection)
Power Shell Scripts for System Center (Master Collection)
https://www.youtube.com/watch?v=vAyE_vLZoTc&feature=autoplay&list=PL5C001C67EED49696&lf=results_main&playnext=1
For a Copy a Folder Dim wShellstrComputer = “.”Set objWMIService = GetObject _ (“winmgmts:” & strComputer & “rootcimv2:Win32_Process”)‘errReturn = objWMIService.Create _ ‘ (“cmd.exe /c md c:ups”, Null, Null, intProcessID)Set objFSO = CreateObject(“Scripting.FileSystemObject”) objFSO.CopyFolder “file://172.20.128.51/sms_uk/Oct 2008*.*” , “c:pav” , OverwriteExisting Set wShell = CreateObject(“WScript.Shell”)‘wShell.Run “c:upsElection.html”Const OverwriteExisting = TRUE
First command to start with Powershell is Get-CommandGet-Help ——————-Thanks,https://sccm07.blogspot.com/
Power Shell Learning Commands:- dir -RECURSE ` Start-Transcript filename.txt stop-Transcript I will post to continue this article persistently Paddy
' VBScript' Find the URLs of the currently running Internext Explorer Windows ' References:' https://windowssdk.msdn.microsoft.com/en-us/library/ms630310.aspx' https://msdn.microsoft.com/library/default.asp?url=/workshop/browser/webbrowser/reference/objects/internetexplorer.asp Const IE_EXE = "iexplore.exe" Call FindCurrentURLs(strURLSet)WScript.Echo strURLSet wscript.quit(0) Function FindCurrentURLs(ByRef strURLSet) Dim objShell, objWindowSet, objWindow Dim strwindowName, strURL, strFullName Set objShell = CreateObject("Shell.Application") ' Create a Windows shell automation object Set objWindowSet = objShell.Windows ' Get the collection of open windows belonging … Read more
Enumerating URLs in Internet Explorer # PowerShell $shell = new-object –com Shell.Application $windows = $shell.Windows() write-output ($windows.count.ToString() + " windows found") foreach ($window in $windows) { if ($window.FullName -like "*iexplore*") { write-output ($window.LocationURL + ", " + $window.LocationName) }} $shell = $null ' VBScript' Find the URLs of the currently running Internext Explorer Windows … Read more
You can restore it any time open notepad and past the below text and save it Show Desktop.scf file name that all you will get ShowDesktop Icon —————— [Shell]Command=2IconFile=explorer.exe,3[Taskbar]Command=ToggleDesktop ————
Active Directory Scriptinghttps://www.microsoft.com/technet/scriptcenter/guide/sas_ads_overview.mspx?mfr=true ——————————————————————————————– rem this code creates a user account with the common name MyerKen: Set objOU = GetObject("LDAP://ou=Management,dc=NA,dc=fabrikam,dc=com")Set objUser = objOU.Create("User", "cn=MyerKen") objUser.Put "sAMAccountName", "myerken"objUser.SetInfo Attribute Default Setting pwdLastSet User must change password at next logon userAccountControl Password Not Required userAccountControl Account Disabled ———————————————————————Setting a User Account Password Set objUser = GetObject _("LDAP://cn=MyerKen,ou=Management,dc=NA,dc=fabrikam,dc=com") … Read more
VBS script with source and destination folder input dialog boxes as well as hard coding the RoboCopy command line switches opposed to issuing the commands from the command prompt Set objShell = CreateObject("Wscript.Shell") objSource = InputBox("Enter Source") objDestination = InputBox("Enter Destination") objCommand = "RoboCopy.Exe " & Chr(34) & objSource & … Read more