Powershell: Set Mouse Pointer Scheme to NONE for XenDesktop VM's

Why to do this? Better user experience; reduced cpu load on zero client devices like xenith compared to aero mouse scheme. Powershell Script [code language=”powershell”] $RegConnect = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey([Microsoft.Win32.RegistryHive]"CurrentUser", "$env:COMPUTERNAME") $RegCursors = $RegConnect.OpenSubKey("Control Panel\Cursors", $true) $RegCursors.SetValue("", "") $RegCursors.SetValue("AppStarting", "") $RegCursors.SetValue("Arrow", "") $RegCursors.SetValue("Crosshair", "") $RegCursors.SetValue("Hand", "") $RegCursors.SetValue("Help", "") $RegCursors.SetValue("IBeam", "") $RegCursors.SetValue("No", "") $RegCursors.SetValue("NWPen", "") $RegCursors.SetValue("Scheme Source", 0, …

Powershell change wallpaper using Windows API – SystemParametersInfo from user32.dll

[code language=”powershell”] ######################################################################################################## $setwallpapersource = @" using System.Runtime.InteropServices; public class wallpaper { public const int SetDesktopWallpaper = 20; public const int UpdateIniFile = 0x01; public const int SendWinIniChange = 0x02; [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)] private static extern int SystemParametersInfo (int uAction, int uParam, string lpvParam, int fuWinIni); public static void SetWallpaper ( …

LockWorkstation using Powershell and pInvoke

[code language=”powershell” title=”Powershell Code”] $signature = @’ [DllImport("user32.dll", SetLastError = true)] public static extern bool LockWorkStation(); ‘@ Add-Type -MemberDefinition $signature -Name CustomName -Namespace CustomNamespace -PassThru [CustomNamespace.CustomName]::Lockworkstation() [/code] Notes Keyword PUBLIC is a must, or else wont be able to call the native function. Unlike variables, Add-Type cant be changed once created in a powershell session. …

WordPress Appliance - Powered by TurnKey Linux