Setting up environment for PowerShell scripting

The first step that every PS scripter should do is to set ExecutionPolicy appropriately.  If you work at the developer level, where you have to run various scripts/code from other sources and can validated the script actions only then setup it to Unrestricted. Otherwise RemoteSigned is the recommended value.   Setting up PS ExecutionPolicy to to Unrestricted: You need to run this cmdlet as admin user: PS C:> Set-ExecutionPolicy Unrestricted PS C:> Get-ExecutionPolicy Unrestricted PS C:> Otherwise PS will err at you as shown below: PS C:> Set-ExecutionPolicy Unrestricted   Execution Policy Change The execution policy helps protect you from […]

Read more

Active Directory Objects Attributes

Listing all attributes of a computer object: C:>AdFind.exe -default -f name=”Test-PC1″ | cut -f2 -d”>” | cut -f1 -d”:” | uniq | sort AdFind V01.42.00cpp Joe Richards ([email protected]) April 2010 1 Objects returned accountExpires badPasswordTime badPwdCount cn codePage countryCode dNSHostName dSCorePropagationData distinguishedName dn instanceType isCriticalSystemObject lastLogoff lastLogon lastLogonTimestamp localPolicyFlags logonCount msDS-SupportedEncryptionTypes name objectCategory objectClass objectGUID objectSid operatingSystem operatingSystemVersion primaryGroupID pwdLastSet sAMAccountName sAMAccountType servicePrincipalName uSNChanged uSNCreated userAccountControl whenChanged whenCreated C:> Listing all attributes of a user object: C:>adfind -default -f “(&(objectcategory=user)(name=*test-user1))” | cut -f2 -d”>” | cut -f1 -d”:” | uniq | sort AdFind V01.42.00cpp Joe Richards ([email protected]) April 2010 1 […]

Read more

XenApp: Application launch fails via Citrix client/web interface

Error: ————————— Farming MIS APP ————————— Run-time error ‘372’: Failed to load control ‘ucFldCostTab’ from .  Your version of  may be outdated.  Make sure you are using the version of the control that was provided with your application. ————————— OK —————————   Symptoms: Application launches fine for the administrative user accounts both locally and via Citrix client/web interface Application Launch via Citrix web interface  results in the above shown Run-time error ‘372’ for any other accounts Works fine when you add the failing account to administrators group   Troubleshooting: Run Procmon on the XenApp server Launch the application as non-admin […]

Read more