Managing UAC with PowerShell

User Account Control (UAC) is a security component that enables users to perform common tasks as non-administrators, and as administrators without having to switch users, log off, or use Run As. By separating user and administrator functions, UAC helps users move toward using standard user rights by default. UAC can be managed using the registry. … Read more

Disabling NetBIOS over TCPIP

1. Manual Procedure Go to Control Panel Network and Sharing Center   . Click “Change adapter settings“ . Right-Click a Network Interface Card Properties . Select “Internet Protocol Version 4 (TCP/IPv4)” Properties . Click “Advanced…“ . Select “Disable NetBIOS over TCP/IP“ . . 2. Script Here is a script allowing to disable NetBIOS over TCP/IP … Read more

Files and Folders Security with VBS

The following script allows to modify the security of files or folders (including sub-folders and content). In the following example, the following actions are executed: Creation of an INF file in C:\Temp (Security.inf) This INF allows to grant read and write access rights to the folder C:\Program Files\Soft\Folder and the file C:\Windows\system32\File Execution of the INF … Read more

Remove Certificates using PowerShell

1. Process This article details the way to remove certificates using PowerShell. The Cmdlet used to delete certificates is Remove-Item   Let’s take for example the following certificate: SCOM-ECO.   To check if the certificate is present in the store of the machine:           Launch the PowerShell Console.       … Read more

Send Email with PowerShell

The following script allows to send an email in HTML using SMTP with PowerShell. The script does not prompt for credentials (the user account and its according password are set into the script itself). To avoid writing user account and password in the script, Get-Credentials can be used to prompt the user for username and password. … Read more

Starting Runbook with PowerShell

To start an orchestrator runbook with PowerShell, Microsoft provide a reliable script in its MSDN web site. https://msdn.microsoft.com/en-us/library/hh921685.aspx   But, as prerequisite, the script needs the GUIDs for runbook and runbook parameters. There are different ways to find these GUIDs. One of the easier is to use Excel, and more specifically the PowerPivot plugin. Thank … Read more

Wait for a Process to Finish with VBScript

Sometimes the .exe process exit directly after launched. In this case, it’s necessary to wait until the process .exe not be there anymore to validate that the command is executed correctly. Here is a possibility to wait for a process to finish before continuing using VBScript. In the following example, we wait the process notepad.exe … Read more

Create Local User with VBScript

This script allows to create a local user using VBScript.   In this example: Creation of a local user (login “dam” / Password “dampwd”) Selection of the option “User cannot change password” Selection of the option “Password never expire” Selection of the option “Account deactivated” To play with local users, we use the property ComputerName … Read more

Update XML with VBScript

This script allows to update data in a XML file. In this example, the following XML file is edited: “C:\Program Files (x86)\Editor\Application\MyFile.xml” The modification will affect the following node in the XML: “//parentnode/targetnode” The new value inside the node is: “Value to add in the node” To play with XML files, the object “Microsoft.XMLDOM” must be used. … Read more

Install Packages with VBScript

This script is a template of package launcher. It gathers many functions allowing to install a package using generic VBScript functions: Check if a package is installed (MSI) using the registry Uninstall a package if installed EXE silent uninstallation Single MSI installation MSI + MST installation EXE silent installation EXE + ISS response file silent … Read more