rundll32 printui.dll,PrintUIEntry /ga /n\\server\printer ref > https://www.papercut.com/kb/Main/MakingPrintersAvailableToAllUsers#easier-methods-to-deploy-printers https://www.robvanderwoude.com/2kprintcontrol.php
Category Archives: Windows 7
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, …
Continue reading “Powershell: Set Mouse Pointer Scheme to NONE for XenDesktop VM's”
Troubleshoot Tips – Account lockout
look for 4740 event id under security of domain controller event logs.
Force User to Change Password a day before their password expires
[code language=”powershell” title=”Powershell code snippet”] Get-ADUser -Filter ‘(enabled -eq $true) -and ((passwordneverexpires -eq $false) -and (pwdlastset -ne 0 ))’ -properties MsDS-UserPasswordExpiryTimeComputed | sort-object name | select-object Name,sAmAccountName,@{Name="PasswordExpiry";Expression={(([datetime]::fromfiletime(($_."MsDS-UserPasswordExpiryTimeComputed"))))}} | % { if(($_.PasswordExpiry -ne $null) -and ((($_.PasswordExpiry – (Get-Date)).Days) -le 1)) { Set-ADUser $_.Name -ChangePasswordAtLogon $true } } [/code] Schedule task on AD [code language=”powershell” title=”Complete Powershell …
Continue reading “Force User to Change Password a day before their password expires”
Disconnect ICA session from inside
[code language=”csharp” title=”C# .Net”] /******************************************************************** * Citrix Server SDK WFAPI Component * Author: Siva Mulpuru * The following code invokes the WFDisconnectSession in WFAPI.dll * Works on XenDesktop and Xenapp ICA session **********************************************************************/ using System; using System.ComponentModel; using System.Runtime.InteropServices; namespace ICA_Disconnect { class Program { const int CurrentSession = -1; static readonly IntPtr CurrentServer = …
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. …
Continue reading “LockWorkstation using Powershell and pInvoke”
Delete shortcut pointing to a specific URL
There will be cases where some users are asked to test a dev/training webapp. Few of these users tend to create shortcuts/bookmark to the dev/training webapp and still keep using the dev even after the webapp was rolled to production. Desktop guys to rescue to clean out these shortcuts or bookmarks 🙂 [code language=”css” title=”Powershell …
Continue reading “Delete shortcut pointing to a specific URL”
SetDefaultPrinter using Pinvoke and Powershell
[code language=”powershell” wraplines=”false” collapse=”false”] $code = @’ using System; using System.Runtime.InteropServices; namespace ChangeDefaultPrinter { public class Program { [DllImport("Winspool.drv", CharSet=CharSet.Auto, SetLastError=true)] private static extern bool SetDefaultPrinter(string printerName); public static bool Run(string PrinterName) { bool default_result = SetDefaultPrinter(PrinterName); return default_result; } } } ‘@ cls Add-Type -TypeDefinition $code -Language CSharp #Set Default Printer – for network …
Continue reading “SetDefaultPrinter using Pinvoke and Powershell”
Client side XENAPP Session enumeration and selective logoff based on XenApp Server using ICA Client Object (WFICALib)
In my previous post i used AutoIt script to achieve this and now finally figured out to do it using ICA Client Object (WFICALib) [code language=”powershell” title=”PowerShell Script”] #the following keys need to be set on 32bit machine; for x64 use wow6432node. #HKLM\Software\Citrix\ICA Client\CCM\AllowLiveMonitoring=1 (DWORD 32) #HKLM\Software\Citrix\ICA Client\CCM\AllowSimulationAPI=1 (DWORD 32) #Use Program Files (x86) for …
Force logoff XenApp 6/6.5 Session at Disconnect
Two ways to achieve this http://support.citrix.com/article/CTX126775 Computer Configuration/Administrative Templates/Windows Components/Remote Desktop Services/Remote Desktop Session Host/Session Time Limits/Set time limit for disconnected sessions The least one may set is 1 minute. But there are use cases where you may want this to happen right after disconnect. The next method achieves this. http://support.citrix.com/article/CTX127491 Configure [code language=”text” highlight=”2,4″] …
Continue reading “Force logoff XenApp 6/6.5 Session at Disconnect”