PowerShell Script for Local Admin

Securing Windows Systems with Intune: Deploying PowerShell Script for Automated Local Admin Account Management I have a situation where I need to create a local administrator account with Microsoft Intune Powershell script and deploy it to Windows Devices. Key Features: Deploy from Intune as Powershell script Ready to Deploy? Download the below script.

Powershell script to download the given links in text file, it’s like your download manager

 ‘Powershell script to download the given links in text file, it’s like your download manager $folder = “E:ThinkPad W500” $userAgent = “Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1” $web = New-Object System.Net.WebClient $web.Headers.Add(“user-agent”, $userAgent) Get-Content “E:WIPurls.txt” |     Foreach-Object {         “Downloading ” + $_         try … Read more

Export the task sequence SCCM 2012 to XML format (legacy format of sccm 2007)

Export the task sequence SCCM 2012 to XML format (legacy format of sccm 2007) SCCM 2012 task sequences can be exported in .zip format and when we handle/extract it will not work. Below is only applicable from sccm 2012 SP1 and above With help of Power shell we can extract this in XML format.   … Read more

PowerShell script to check WDS Service status against of List of servers.

Below is a PowerShell script, this will list WDS Service status against of List of servers. Below is a powershell script will list WDS Service status againest of List of servers. $InPutComputersList = get-content “c:MyScriptslist.txt”$OutPutFile = “c:MyScriptsWDS_ServiceStatus.csv”$NotReachble = “c:MyScriptsNonPingSystems.csv”$listResult = @()foreach($ForEverComputerIntheTextFilelinebyLine in $InPutComputersList) {if (test-path $ForEverComputerIntheTextFilelinebyLinec$windowswrite.exe) {$objService = Get-Service WDSServer -ComputerName $ForEverComputerIntheTextFilelinebyLine | select machinename, … Read more

Script to check the drive space in the server against the threshold value and triggers an alert

Script to check Disk Space #Purpose: Script to check the drive space in the server against the threshold value and triggers an alert#powershell script for disk space monitoring $computer = get-content -path .list.txt #get-content env:computername; #Get the server name$percentWarning = 50; # Store the percentage warning threshold$disks = Get-WmiObject -ComputerName $computer -Class Win32_LogicalDisk -Filter “DriveType … Read more

Powershell in Visual Studio 2010

Steps Involved: Open Visual Studio 2010. Go to File => New => Project. Select Class Library template, enter the name and click Ok. Add the following references. -System.Management.Automation.dll (C:Program Files (x86)Reference AssembliesMicrosoftWindowsPowerShellv1.0System.Management.Automation.dll) -System.Configuration.Install.dll (C:WindowsMicrosoft.NETFrameworkv2.0.50727System.Configuration.Install.dll -Microsoft.SharePoint.dll (C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions14ISAPIMicrosoft.SharePoint.dll) -Microsoft.SharePoint.PowerShell.dll    (C:WindowsassemblyGAC_MSILMicrosoft.SharePoi

PowerShell in Nutshell learn from these steps

Stage 1 WebCast: Scott Hanselman – Developer Productivity Tools Part 3 WebCast: PowerShell Week – Day 2: CmdLets Tutorial: MS Scripting Center Task-Based Tutorial PDF Quick Reference: PowerShell Cheat Sheet Podcast: HanselMinutes – Monad (show 11) Blog post: Learning PowerShell without leaving the command line Stage 2 CmdLet Exploration: Try all built-in CmdLets using Get-Command, … Read more

Powershell :- System Management Container

If you want to create Systems Management Server (SMS) 2003 or System Center Configuration Manager (ConfigMgr / SCCM) 2007, Container i.,e “System Management” with Power shell here it is the Cmdlts     # Get the distinguished name of the Active Directory domain$DomainDn = ([adsi]””).distinguishedName# Build distinguished name path of the System container$SystemDn = “CN=System,” … Read more