by lunarg on November 25th 2020, at 10:12

There are many ways to verify the syntax of a Powershell script (other than running it of course), but the most simple and useful is this one:

Get-Command -Syntax 'path\to\script.ps1'

If the syntax is valid, it will simply return the name of the script. If there are errors, it will provide a detailed syntax error report.

by lunarg on November 16th 2020, at 15:31

Using Powershell, you can quickly verify the status of the replication between domain controllers in Active Directory. This can be used in monitoring to verify a healthy AD replication. This can be run on any domain controller or on another system with RSAT or ActiveDirectory Powershell module.

Get-ADReplicationPartnerMetadata -Target "$env:USERDNSDOMAIN" -Scope Domain | FT -Auto Server,LastReplication* To see forest-wide replication, replace -Scope Domain with -Scope Forest. by lunarg on November 13th 2020, at 16:52 By default, Adobe Reader DC pummels you with all kinds of offers for trial versions and cloud accounts, which can be annoying for yourself and your users. Luckily, it can be turned off through a few well-placed registry keys, as described in the Enterprise Toolkit. Create the following key(s):HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Adobe\Acrobat Reader\DC\FeatureLockDown\cIPM HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Policies\Adobe\Acrobat Reader\DC\FeatureLockDown\cIPM (for 32-bit app on 64-bit Windows) Create these DWORD-values and set them to zero:bDontShowMsgWhenViewingDoc (DWORD) = 0 bShowMsgAtLaunch (DWORD) = 0 bAllowUserToChangeMsgPrefs (DWORD) = 0 Note that the value for bDontSh ... by lunarg on November 13th 2020, at 13:30 While heavily deprecated and frowned upon, sometimes you'd still need to use the SMB1 protocol in Windows 10. You can effortless enable this through the GUI (Control Panel → Add/Remove Programs), it may be necessary to install it through scripting (e.g. for automated install). One of the methods is through Powershell. Enabling the SMB1 client but not the server (or vice versa) is a multi-step process, as it's not possible to "only" enable the SMB1 client. First, you need to enable everything of SMB1, then disable the unneeded sub-features. An important item to disable is the SMB1 Deprecation option, as leaving this enabling could result in the automatic removal of all SMB1 fe ... by lunarg on November 11th 2020, at 14:40 I ran into an issue where a local group policy had settings that were not accessible or editable using the conventional Local Group Policy editor (gpedit.msc), causing unwanted settings to be re-applied each time the group policy was refreshed. After a bit of searching around on the internet, I found a Powershell module with the ability to add, edit and remove individual items directly from Registry.pol policy files. The module PolicyFileEditor can be downloaded and installed easily through Powershell: Install-Module -Name PolicyFileEditor As with everything from PSGallery, you need to have NuGet installed and updated. The module comes with examples on how to use it. It can also be viewe ... by lunarg on November 9th 2020, at 16:43 If you are using multi-factor authentication, it is not possible to use the old method of connecting to Exchange Online. You will have to install the Exchange Online PowerShell Module, and use the Connect-ExchangeOnline cmdlet to connect. With the deprecation of Internet Explorer, the old method below no longer works. Use the method described here to install: Installing Exchange Online Management Powershell cmdlets Old instructions Log on to Exchange admin center. In the left menu, click on hybrid. Click the configure button for the Exchange Online Remote PowerShell Module. This will start the installation. In the Application Install that appears, click the Install button. When using ... by lunarg on November 9th 2020, at 16:34 With the deprecation of Internet Explorer, it is currently no longer possible to install the Exchange Online Powershell module via ECP. But you can also install the Exchange Online Powershell module via Powershell itself: First install the dependencies: Install-PackageProvider -Name NuGet -Force Install-Module -Name PowerShellGet -Force Next install the Exchange Online Management module: Install-Module -Name ExchangeOnlineManagement by lunarg on November 4th 2020, at 09:57 Using PowerCLI, you can easily retrieve the status of CPU/Memory hot-add/remove. After logging in (use Connect-ViServer), run this cmdlet: (Get-VM | Select ExtensionData).ExtensionData.config | FT -Auto Name, MemoryHotAddEnabled,CpuHotAddEnabled,CpuHotRemoveEnabled If you only want a list of VMs which have hot-add/remove enabled for either CPU or memory, you can use filters to filter on this: (Get-VM | Select ExtensionData).ExtensionData.config | ? {$_.MemoryHotAddEnabled -eq $true -or$_.CpuHotAddEnabled -eq $true -or$_.CpuHotRemoveEnabled -eq \$true} | Select Name, MemoryHotAddEnabled,CpuHotAddEnabled,CpuHotRemoveEnabled | FT -Auto

To export the result to CSV, replace the FT -Auto in t  ...
 « ‹ November 2020 › » Sun Mon Tue Wed Thu Fri Sat 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30