# Powershell script to change\set Registry Key Permissions with Subkeys for a User

Powershell script to set Registry Key Permissions with Subkeys for a User ( Needs to be run as admin as its changing things in HKCU:\Software\Policies

$acl = Get-Acl HKCU:\Software\Policies\Google$inherit = [system.security.accesscontrol.InheritanceFlags]"ContainerInherit, ObjectInherit"
$propagation = [system.security.accesscontrol.PropagationFlags]"None"$rule = New-Object System.Security.AccessControl.RegistryAccessRule ("domain\user","FullControl",$inherit,$propagation,"Allow")
$acl.SetAccessRule($rule)
\$acl |Set-Acl -Path HKCU:\Software\Policies\Google
VN:F [1.9.22_1171]
VN:F [1.9.22_1171]

# iManage set default Author and Document Class

You can set the author and default document class by setting the following registry key. The variable %USERID% will resolve to the user that is logged in.

[HKEY_CURRENT_USER\Software\Interwoven\WorkSite\8.0\iManExt\DefaultNewProfile]
“382”=”%USERID%”
“384”=”DOC”

VN:F [1.9.22_1171]
Rating: 9.0/10 (1 vote cast)
VN:F [1.9.22_1171]

# How to enable to To-Do Bar – Tasks in Outlook via Registry for Deployment

For a new deployment we needed for Outlook to show the Task’s ToDo List on the Outlook Home Screen

I couldn’t find this documented anywhere so I have to monitor the Outlook.exe during the change to find out what Registry Key it changed

Location

HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Preferences

Item : PinMail

Type : Dword

Value : 4

VN:F [1.9.22_1171]
VN:F [1.9.22_1171]

# How to restore a Domain Controller in a DR Situation

Upon restoring a domain controller to a new or isolated network in example a DR environment, the domain controller will lose access to its other domain controllers for replication. You might find you cannot start the DNS server and or Active directory services.

To force the server to start without checking for others modify the below key and reboot the server

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NTDS\Parameters
Value name:  Repl Perform Initial Synchronizations
Value type:  REG_DWORD
Value data: 0

You should then go into Active Directory Sites and services and remove the old Domain Controllers and Also go into the DNS server and remove any references in the Nameserver tabs for the Zones

_msdcs.domain.local

domain.local

VN:F [1.9.22_1171]
VN:F [1.9.22_1171]

# Windows 10 Shutdown Puts it to Sleep rather than shutdown

Recently had an issue where Group Policies were not applying to a machine.

Gpresult /r showed the group policy

On checking the machine, the Up Time was over 30 days. The user said she had shutdown the computer. Turns out Windows 10 has a default option called “fast startup” which Sleeps the computer on shutdown!

To disable this Disable the GPO

Computer Configuration\Policies\Administrative Templates\System\Shutdown\Require use of fast startup does set the following registry key HKLM\SOFTWARE\Policies\Microsoft\Windows\System\HiberbootEnabled=0 (REG_DWORD)

Set the Registry key

HKLM\SYSTEM\CurrentControlSet\Control\SessionManager\Powerfix\HiberbootEnabled=0

VN:F [1.9.22_1171]
VN:F [1.9.22_1171]

# The issue is that Office 2016 limits the search results to 75 items

It seems on some setups Office 2016 limits the search items display to 75

###

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Outlook\Search]

“SearchResultsCap”=dword:00000000

“DisableServerAssistedSearch”=dword:00000001

###

SearchResultsCap overrides how many items are viewable in your search results. 0 is all.

DisableServerAssistedSearch disables the server-side search engine and uses your local computers search

VN:F [1.9.22_1171]
VN:F [1.9.22_1171]

# Installing VSTO run once

How to uninstall vsto

How to silently install vsto

How to install via group policy

 Source code
@echo off
REM Check for presence of vsto key first if not found run installer
reg query HKEY_CURRENT_USER\Software\Microsoft\Office\Word\Addins\DCCWord2010 /e >nul 2>nul || ("C:\Program Files\Common Files\Microsoft Shared\VSTO\10.0\VSTOInstaller.exe" /I "\\path\to\vsto\AddIn.vsto" /S)

Turns out using this

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Runonce

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run

vbs file via run registry  ( The advantage of using this is it runs once for each user however they will need to log in twice if they are logged off!)

Turns out using this registy value HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Runonce The user needs to be a local administrator…

So we had to put the value inside here : HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run , and let the file remove it after running

Group Policy Registry key to add to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run

Link as my hosting doesn’t allow these file types! http://pastebin.com/SNzSP2Xw

vbs script

 Source code
Dim commandDim WshShellcommand=chr(34) & "%CommonProgramFiles%\Microsoft Shared\VSTO\10.0\VSTOInstaller.exe" & chr(34) & " /Silent /Install " & chr(34) & "\\path\to\vsto\AddIn.vsto" & chr(34)
Set WshShell = WScript.CreateObject("WScript.Shell")WshShell.Run command
'Delete the Run Key to make sure it runs once - we cannot put this in the run one registry due to users not being administrators
Const HKEY_CURRENT_USER = &H80000001
strComputer = "." Set objRegistry=GetObject("winmgmts:\\" & _  strComputer & "\root\default:StdRegProv") strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Run"strValueName = "ExternalPDatabases"
objRegistry.DeleteValue HKEY_CURRENT_USER, strKeyPath, strValueName

VN:F [1.9.22_1171]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.22_1171]

# Nitro PDF Group Policy Registry Settings

I wanted to disable the “Tell me if Nitro Pro is not the default viewer” option on startup for each user via group policy. We can set this using Nitro custom MST creator with deploymentutility9_en.exe , however this works as below

1. On installation we write a large number of preferences to \HKEY_LOCAL_MACHINE\SOFTWARE\Nitro\Pro\9.0\settings\

First Launch (User)

2. On a users first run we copy the local machine keys to HKEY_CURRENT_USER\SOFTWARE\Nitro\Pro\9.0

3. We then load on startup these keys to memory for use during the operation of Nitro Pro 9

4. When the application is closed, any changes are written back to HKEY_CURRENT_USER so they can be accessed on the next launch

So once it set once the user can change this, I added the following update registry key to set this every time the user logs in to make 100% the user does not click yes!

Path1 : HKCU/ \Software\Nitro\Pro\9.0\settings\kPreferances

Key : kPrefGeneralMsgIfNotDefaultPDFViewer

Type : String

Value : /b 0 – where 1 is Yes and No is 0

## Uncheck Prompt for FileName for all users

I have managed to isolate what drives the configuration for these panels.

Screencast : http://screencast.com/t/vivqspya9Y
Sample Files : https://nitropdf.box.com/s/iy09jagvwswi2452ccy1
Location : %temp%

## Change Word Format Nitro Converts from PDF to Doc

Word Format – To configure in the Word Convert format you can specify the following HKLM (install) and then after first run HKCU defined key.
Location : HKEY_CURRENT_USER\Software\Nitro\Pro\9.0\Settings\Preferences\kPreferences
Name : kPrefConvertPDFToWordFormat
Type : String
Value : /i 0 | /i 1 (0 = DOCX, 1 = DOC)

## Combine

This area hasn’t been configured to be completely silent in the same regards as above. The output will always be indexed ‘Untitled.pdf’, however you can configure the output location in the registry through the following registry key. This will mean that the creation occurs immediately however the name will not be pre-configured for you at this stage. To take advantage of this you will need to configure the registry keys manually shown here

located under HKEY_CURRENT_USER\Software\Nitro\Pro\9.0\Settings\Preferences\kCombinePDF.

## Creation Quality

You will need to swap out some values for the higher quality option, these are:

Quality Keys = 100

Compression = 3

VN:F [1.9.22_1171]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.22_1171]
Rating: +1 (from 1 vote)

# Override Group Policy for ‘do not use proxy server for address beginning with’

“Do not use proxy server for addresses beginning with”

Setting’s in internet explorer. The box was greyed out via group policy , however this was just for a single user using a a remote citrix enviroment and didn’t have the time to roll it out through Group Policy.

Windows stores the entry in the following location :

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]

“ProxyOverride”=

So open up regedit and modify the enteries via this key!

VN:F [1.9.22_1171]