Friday, April 25, 2014

Disable windows offline files:

Local Computer Policy\Computer Configuration\Administrative Templates\Network\Offline Files
Change the following:
Allow or disallow use of offline files feature: Disabled
Prohibit user config: Enabled
Sync all offline files when logging on: Disabled
Sync all offline files when logging off: Disabled
Sync offline files before suspend: Disabled
Remove ‘Make offline’: Enabled
Prevent use of Offline Files folder: Enabled

Wednesday, April 16, 2014

Script to delete vmware snapshots, batch file to run as a scheduled task

Run this from power shell to delete your snapshots:

Connect-VIServer vsphereserver

Get-vm "guest vm" | get-snapshot | Remove-Snapshot -confirm:$false

save it as something .ps1

Batch file:
C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -psc "C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\vim.psc1" -c ". \"C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-VIToolkitEnvironment.ps1\";C:\vmwarescript\yourpowershellscript"


Machine running this will need VMWare powercli installed.  

If your user is not an admin that will be running the script as a scheduled task it will need logon as batch job and service rights and explicit rights to the CMD.exe file in C:\windows\system32.

Thursday, April 10, 2014

Office 2013 tweaks

Keep office from trying to connect to the internet with this registry key:

HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Common\Internet\useOnlineContent

Set Dword to 0

Have Office go directly to a document screen and pass the annoying startup page:
HKEY_CURRENT_USER\Software\MicrosoftOffice\15.0\ommon\General
Create a DWord of DisableBootToOfficeStart
Set DWord to 1

Friday, February 7, 2014

If you move mailboxes and they don't remove here is a cleanup command

set the keep deleted mailbox retention period to 0, run clean-mailboxdatabase "databasename" to remove the disconnected mailboxes. 

Monday, January 6, 2014

Clear log files for exchange if your out of disk space

Dismount any databases, or if the database won't mount because the disk is full.  If the database won't mount, check and make sure it is in a clean shutdown state:

eseutil /MH "Database Location and Name"

Make sure it reports "clean shutdown" or "consistent"

MOVE the log files to somewhere you have space and remount the database.

Friday, January 3, 2014

Users redirectored folders show as My Documents in the folders

If you are redirecting folders to a server share and the folders all show as "My Documents" this could be due to the desktop.ini in the root of the users folder.  If the administrators or domain admin group has full control, set them to deny read.  Make sure the user is the owner of the folder as well.

Friday, December 27, 2013

Use PSEXEC to run a command against a list of machines and have it run a command from the machine

Start by creating a list of computers that need the command run on them (pclist.txt.).  Use the file copy command for /f %a in (pclist.txt) do copy /y \\server\share\file.bat \\%a\c$\ to copy the files to the machines in the pclist.txt.  In this example the file is copied to the root.  Next, from an elevated command prompt run:
psexec @pclist.txt c:\file.bat

This will execute the batch or exe file you copied to the remote machine on the remote machine. 
If you need to authenticate run:
psexec @pclist.txt -u domain\user c:\file.bat and it will prompt for a password.