Posts

Showing posts with the label PowerShell

Solving Installation Problems with .NET 3.5 on Windows Server 2012 R2

While newer versions of Windows Server (2022/2025) have improved, installing .NET 3.5 still frequently fails because the payload is not part of the local Side-by-Side (SxS) store. The easiest way to solve this is to point the installer to the original installation media. 2026 Update: This method remains the gold standard for Windows Server 2022 and 2025 . If you are in an air-gapped or WSUS-managed environment, the GUI will fail unless you provide this alternate path. Option 1: The Fast Way (DISM) Mount your Windows Server ISO (usually as drive D: or E: ) and run this from an elevated Command Prompt. This forces the server to use the media instead of trying to reach Windows Update. dism /online /enable-feature /featurename:NetFx3 /all /Source:D:\sources\sxs /LimitAccess Option 2: The PowerShell Way If you prefer PowerShell, use the following command. The -Source parameter is key here. Install-WindowsFeature -Name NET-Framework-Core -Source D:\sources\sxs ...

HOW TO: Setup IIS Web Server in Windows Server 2012 Using PowerShell

Automating IIS setup via PowerShell is a foundational skill for maintaining consistent web environments. While the core steps remain the same, modern Windows Server versions (2019/2022/2025) have introduced the IISAdministration module as the preferred path for automation. Modern Update (2026): Microsoft now recommends the IISAdministration module over the legacy WebAdministration module. It is built for the PowerShell object pipeline, offering better performance and more reliable transactional commits. 1. Install the Web Server Role This command installs the base IIS role along with the required management tools for PowerShell control. Install-WindowsFeature -Name Web-Server -IncludeManagementTools 2. Create an Application Pool If you are using a Group Managed Service Account (gMSA) for your pool identity, ensure your username ends with a $ (e.g., svc_webapp$ ). # Modern IISAdministration method Import-Module IISAdministration $poolName = "MyApplicati...

HOW TO: Setup Active Directory Domain Services (AD DS) in Windows 2012 Using PowerShell

If you're looking to create an unattended installation scenario for Active Directory, one approach would be to script your installation using PowerShell. This article describes the installation steps for Active Directory Domain Services. While originally written for Server 2012, these steps remain the standard for modern Windows Server deployments. 2026 Update: For modern deployments (Windows Server 2022/2025), ensure your Forest and Domain functional levels are set to at least Win2016 or Win2025 . Preparation Steps for All Future Domain Controllers 1. Set Timezone Appropriately Using tzutil tzutil /s "Eastern Standard Time" 2. Install AD DS Windows Role Install-WindowsFeature -name AD-Domain-Services -IncludeManagementTools 3. Ensure AD DS Windows Service is set to Automatic Set-Service -Name "NTDS" -StartupType "Automatic" Configuring the Initial Domain Controller (New Forest) The following script handles the ...

Stuck in the Past! SharePoint Alerts Pointing to An Old URL After Migration?

I've run into this personally a couple of times and never really documented my own solution so that I had it for myself to reuse. If the URL for your SharePoint Farm ever changes, you're more than likely to start hearing from your users that the alert subscription emails they get still point to the old Farm URL. I've encountered this on SP 2007 and SP 2010 Farms. As it turns out, each Alert Subscription contains a hard-coded server root URL which is used when the alert email is generated to construct links. I wrote the PowerShell script below to loop through all Web Applications of the server and perform an update on all Alert Subscriptions. I like my scripts that need to be run on all sites to run through my whole farm rather than one site at a time. This script works on both SP 2007 and SP 2010. It will skip the Central Admin Web Application, your SSP, and MySite sites. $oldrooturl = "https://<url>" [System.Reflection.Assembly]::LoadWithPartialName(...

SharePoint Closed WebParts Slowing You Down? Migrating from SharePoint 2007 to 2010 and Can't Find an Easy Way to Resolve (preupgradecheck) Findings? PowerShell's Got Your Back!

Performance is a concern of every system administrator, unless you're an Information Assurance kind of guy and then you'd probably just assume see the server switched off (just a bit of a nudge). If SharePoint is your poison, watch out for Closed WebParts throughout your site. Closed WebParts are still attached to your page and are temporarily hidden, but they still load when the page loads. If there are a number of them, or any with Fatal Errors, you're unnecessarily impacting page load times and probably filling your logs with errors that are difficult to track down. Worse yet, if you plan a migration from SharePoint 2007 to 2010 and run the preupgradecheck STSADM command, you'll find yourself with a list of potential upgrade problems and no clear path to resolve them. The handy PowerShell script below can help with both. It will iterate through all of the web applications on your server and the pages at the root of each site (it doesn't look at pages in libr...