Are you ready for another wave of script samples? Here are 13 new script samples for Windows, SharePoint and IE. As always, the script samples are based on frequently asked IT tasks that we collected in TechNet forums.
Windows and Windows 8 Script Samples
Script to refresh Windows 8
Description: This PowerShell Script shows how to create custom refresh image of Windows 8.
User Scenarios: Windows Refresh gives you a quick and easy way to start with a clean slate while also maintaining your apps, data, Windows settings, and user profile.
How to Delete the "Windows.old" Folder in Windows 8 (PowerShell)
Description: This PowerShell script shows how to delete the "Windows.old" Folder in Windows 8.
User Scenarios: When you performed a refresh of Windows 8, upgrade to Windows 8 or a custom install of Windows 8 without formatting the drive for a clean stall and selected to install Windows 8 on the same partition of the previous Windows installation, then you may have a "C:\Windows.old" folder left over in your new installation. It contains a copy of the previous Windows 8 installation, and can be quite large in size. If users are sure that they don't need this folder any more, they can try to use a script to delete the folder.
Script to display the deleted objects in Active Directory (PowerShell)
Description: This PowerShell script sample can display the deleted objects from the Active Directory.
User Scenarios: Accidental deletion of Active Directory objects is a common occurrence for users of ADDS and ADLDS. This script can display the deleted objects from the Active Directory Recycle Bin.
Script to add an item to Startup in Windows 8 (VBScript)
Description: This VBScript sample shows how to add an item to the Startup in Windows 8.
User Scenarios: Sometimes, users want programs to start when your system starts. Usually, you can add items to the startup folder. In Windows 8, adding items to Startup requires additional work. This script can resolve this problem.
Check if disk partitions are 4KB aligned using PowerShell
Description: This script can be used to check if users' disk partitions are right 4kb alignment. Over the next few years, the data storage industry will be transitioning the physical format of hard disk drives from 512-byte sectors to 4,096-byte sectors (also known as 4K or 4KB sectors). This transition is driven by several factors. These include increases in storage density and reliability. Many customers need to know if their disk partitions have non-4kb alignment issue which will cause incompatibility issues with existing software (including operating systems and applications).
User Scenarios: We can use Test-OSC4kAligned function to check if user’s disk partitions are right 4kb alignment.
Script to fix issues of Event ID 4107 and Event ID 11 (PowerShell)
Description: This sample can help the enterprise administrator to bulk fix the issue “Event ID 4107 or Event ID 11 is logged in the Application log in Windows and in Windows Server “ on all the client computers which have these issues in the enterprise’s domain.
User Scenarios: Event ID 4107 and Event ID 11 error occurs because the Microsoft Certificate Trust List Publisher certificate expired. A copy of the CTL with an expired signing certificate exists in the CryptnetUrlCache folder. To bulk resolve these issues, you can use this script to list all the expired certificates in the specific computer and remove all the files in the CryptnetUrlCache folder.
Script to list the cluster servers (PowerShell)
Description: This script will demo how to list the servers in one or more Windows clusters.
User Scenarios: Sometimes, IT pro need to list all servers in the specified cluster(s).This script is to accomplish it.
Script to disable "turn off this device to save power" for NIC Power Management
Description: This VBS Script illustrates how to disable "turn off this device to save power" feature in Power Management.
User Scenarios: Many users want to disable the option in network device called: Allow the computer turn off this device to save power. Now, this script can help users to disable "turn off this device to save power" feature in Power Management of all physical network adapters.
SharePoint Script Samples
Description: This script enumerates through the user profile manager for a given site collection and would extract information about all profiles from the profile store.
User Scenarios: In SharePoint, we come across issues with profiles not being consistently updated with property values after an import operation. There could be numerous reasons for this; albeit a change in the import connection or the inability to reach and fetch information from a designated Directory server. Besides, the Central Admin UI doesn’t present a holistic view of all user profiles; neither is there an easier way to navigate through hundreds of profiles within the UI.
SPProfileDump would extract all profile information to a comma delimited (SPProfileDump.CSV) file. Additionally, it would also create a SPProfileProperties.TXT file that would contain the very basics of each profile property. You can open the SPProfileDump.CSV file in a tool like Excel and use filtering to view data the way you want. For example, find how many profiles have come through a specific OU or per say, how many users do not have a valid PictureURL.
How to remove users from a site that have a specific permission level
Description: This PowerShell script shows how to remove users from a site that have a specified permission level.
User Scenarios: You cannot remove users from a site by using the UI and it is difficult to find all users that have a specific permission level.
Complete the Reporting Services with SharePoint Integration configuration
Description: This Windows PowerShell script achieves the same function as we to complete configure the Reporting Services integrate to SharePoint in SharePoint Central Administration. This script applies to SQL Server Reporting Services 2008 R2 or SQL Server Reporting Services 2008 integrate to SharePoint 2010.
User Scenarios: When we need to configure SQL Server Reporting Services in SharePoint integrated mode, after installed and configured both SQL Server Reporting Services side and SharePoint side, in traditional way, we need to bind the report server URL and set authentication type in the SharePoint Central Administration. Actually, we can also easily set these steps by using script. It is suitable for bellowing two conditions:
- Never integrated any SQL Server Reporting Services to this SharePoint.
- Had ever integrated SQL Server Reporting Services to this SharePoint, need to integrate one new SQL Server Reporting Services to this SharePoint.
Internet Explorer Script Samples
Setting Tab Process Growth for Internet Explorer (PowerShell)
Description: This sample can help you to operate the “TabProcGrowth” registry entry to set Tab Process Growth(Sets the rate at which IE creates New Tab processes) for Internet Explorer 8 or later. It shows how to get and set Tab Process Growth setting for the Internet Explorer installed on your computer by using PowerShell script.
User Scenarios: If you have been using IE7, you are probably used to all your tabs opening under the same iexplore.exe process. The only exception is if you are on a Windows Vista machine and you are moving from Protected to Unprotected mode. Internet Explorer 8 or later had a big makeover in this area. You will now notice that new tabs typically open in a new process. By default, IE8 will start with two instances of iexplore.exe (one for the Frame, one for the tab) and grows the number of tab processes as needed based on the amount of available RAM, the number of tabs, the integrity levels for tabs, and the number of distinct IE sessions .
Script to remove Internet Explorer in Windows 7 (PowerShell)
Description: This PowerShell script demo shows how to remove Internet Explorer in Windows 7.
User Scenarios: In some situations, customers need to uninstall Internet Explorer 9 to fix crash issue, but they cannot manually uninstall Internet Explorer successfully sometimes.