N. Moseley
This user hasn't shared any biographical information
Homepage: http://t3chn1ck.wordpress.com
SQL Query App-V 5.0 Usage
Posted in App-V 5.0 on May 12, 2013
You can use the following query on your App-V 5.0 reporting server database (AppVReporting) to get application usage information for which users ran which software on which systems and when.
select distinct username, host_name, app_name, start_time from dbo.ApplicationUsage APPU join dbo.ClientInformation CLIINFO on APPU.host_id=CLIINFO.host_id order by start_time desc
Scripting Sybase PowerDesigner Viewer 16.x
Posted in ConfigMgr 07, ConfigMgr 12, Scripting, Troubleshooting on May 8, 2013
Ran into a curious situation when automating the installation of Sybase PowerDesigner Viewer 16. If you just want the answer, then jump to the bottom of this post :-)
The installer was built as a self-extracting InstallShield setup. Typically, for a ConfigMgr package I like to use the extracted files. However, when attempting to run the Setup of the InstallShield installation, an error was generated that “setup.cab” was missing from “Disk2″. This was issue #1.
Since there was no “disk 2″, so I reverted back to just using the native, self-extracting installer. This appeared like it was going to be fairly simple as all defaults were going to be used. Most times, just using /s is enough to complete the silent installation. But no, this would be too easy. The installation would still not run unattended. Eventually I discovered that the only way to automate a silent installation was to create and include a setup.iss record file. Again, this is despite that only the defaults were being used and that a basic setup.iss was already included as part of the extracted files. This was issue #2.
So have we finally figured out how to automate the silent install? Of course not – there is no reason that a simple application should be so easy to automate. Running the install as PDV_16.exe /s /f1″setup.iss” would absolutely install PDV…when executed manually. As soon as it was deployed using ConfigMgr, the setup would fail with an error. Why oh why!?! Turns out that their installer also hates to be run in System context. Which is what we all know is how ConfigMgr needs to do it, especially for Task Sequences. This was issue #3.
After tussling with this application, I finally figured out that not only is a recorded installation (setup.iss) necessary, but so is specifying a location for the log file!! Conclusion? I despise Sybase installers. Answer? Use the following command line.
PDV_16.exe /s /f1"setup.iss" /f2"c:\windows\temp\pdvsetup.log"
One last comment. Make sure the log file is specified in a directory that already exists (such as c:\windows\temp), otherwise you end up with Issue #4. And use a wrapper (such as a batch file) to specify the current working directory of the setup.iss file, otherwise you’ll end up with Issue #5. If using a batch file, the command would like this for your ConfigMgr package:
"%~dp0PDV_16.exe" /s /f1"%~dp0setup.iss" /f2"c:\windows\temp\pdvsetup.log"
Setting up Windows Intune to Manage Android
Posted in Windows Intune on May 1, 2013
Android with Windows Intune
Use this guide to help you get started testing management of Android devices with Windows Intune (Wave D) standalone. This guide assumes Office 365 has been completely set up, configured, and operational for your organization.
Create the emulator
First and foremost, create an Android emulator. One of the best guides that I have found for doing this is at http://www.javaexperience.com/10-easy-steps-to-install-android-emulator-in-windows/. Below are the settings that I used for my emulator.
O365 Mailbox enabled for ActiveSync
Next, ensure that the user account(s) which will be used for testing the Android devices are enabled for ActiveSync.
Enable ActiveSync
Launch the Email app
Enter your username@domain.com and password
Select Exchange
Set the domain/username and server as m.outlook.com
Accept the cert
Configure settings as desired
You’re ready to go!
Activate the device
Once the sync has completed, then you’re connected
Exchange Connector (even for O365)
http://technet.microsoft.com/library/jj733621.aspx
Download the Exchange Connector from Intune (as this has an additional cert included):
Administration > Mobile Device Management > Microsoft Exchange > Exchange Connector
Managing Device Information
Confirm device
Create Android Device Group
Create Android User Group
Create Policy
“Create and Deploy a Custom Policy”
Set a policy name and require a password changed to require a password
Deploy the policy
Ping Transport Failed with Error 1231
Posted in Miscellaneous Ramblings, Troubleshooting on March 30, 2013
Recently I was helping a friend with her laptop which suddenly stopped connecting to the Internet, despite that the wireless networking could see and successfully connect to wireless hotspots. In further troubleshooting, I noticed that the correct IP address range (192.168.0.x) was not handed out by the router’s DNS. Furthermore, when attempting to ping the router’s gateway (192.168.0.1) with “Ping Transport Failed, Error 1231“. Digging through the Internet on this error, I found the possible solution buried deep within a couple Microsoft forum threads. I’m posting it here so that if it should ever occur again, hopefully the solution is quicker to find!
- Open a command prompt with Run As Administrator
- Run “netsh winsock reset”
- Restart Windows
Now the system is back in business!
Installing VMware View Agent in a Task Sequence
Posted in ConfigMgr 12, Scripting, Troubleshooting on March 9, 2013
The VMware View agent is deployable as an MSI file and uses basic command line parameters. However, I recently had significant difficulties with getting it to install within a ConfigMgr Task Sequence as part of an OS image deployment. Despite that the agent could be installed manually using the parameters, in a TS the installer would fail (e.g. return a non-success exit code) and thus fail the TS.
Through investigation, the agent’s install log file (located in %windir%\temp\) stated error 1603 and a message that if failed due to a detected pending restart. So in the TS, I added a pre-restart command prior to the install…..but that still did not solve the problem. Several various other solutions were attempted, but all to no avail.
Eventually I found a VMware KB article which outlined the issue. It was being caused by multiple registry keys – FileRenameOperations, Run, and RunOnce. So I created a quick batch script to
- Backup the reg keys to %windir%\temp
- Delete the reg keys
- Run the install
- Restore the reg keys
:: Backup problem registry keys for VMware Agent Install reg.exe EXPORT "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager" c:\windows\temp\hklmsession.reg /y reg.exe EXPORT "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" c:\windows\temp\hklmrun.reg /y reg.exe EXPORT "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" c:\windows\temp\hklmrunonce.reg /y :: Delete problematic registry keys reg.exe DELETE "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager" /v PendingFileRenameOperations /f reg.exe DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /va /f reg.exe DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /va /f :: Install VMware agent xcopy "%~dp0VMware-viewagent-x86_64-5.0.1-640055.exe" c:\windows\temp /y c:\windows\temp\VMware-viewagent-x86_64-5.0.1-640055.exe /s /v" /qn REBOOT=R" :: Restore registry keys reg.exe IMPORT c:\windows\temp\hklmsession.reg reg.exe IMPORT c:\windows\temp\hklmrun.reg reg.exe IMPORT c:\windows\temp\hklmrunonce.reg del c:\windows\temp\hklm*.reg exit
However, this still wasn’t good enough to solve the problem! The .msi needed to be copied locally to execute AND this needed to be run with 64-bit redirection disabled. It was a mess to figure out and test, but I was able to eventually discover the right combination to have the agent automatically in a Task Sequence!
Another copy of Configuration Manager Setup is already running
Posted in ConfigMgr 12, Troubleshooting on February 21, 2013
Recently built myself a new server for my home lab and decided to build out a new domain. During the setup process of CM12 SP1 (on Win 2012 with SQL 2012 SP1 CU2), the guest VM hung midway through setup and was completely unresponsive. So I reset the VM and ran the CM12 SP1 setup again – it only allowed the site to be uninstalled, which I did. However after immediately trying to install CM12 again, I received error “Another copy of Configuration Manager Setup is already running”.
The fix?
Just restart the server after the uninstall of the site.
Script to Rename Computer During OSD
Posted in ConfigMgr 07, ConfigMgr 12, Scripting on February 16, 2013
In assisting a recent customer implement an upgrade from WinXP to Win7, they requested that the names be changed to fit a new standard as part of the in-place imaging process. In this particular case, all of the computers had a name that ended with a sequential number (1, 2, 3, …) plus an “A” tacked on at the end. They wanted the “A” removed and for the PC name just to end with the sequential number.
This was a pretty easy fix to accomplish through a VBScript which
- Retrieves the active OSDComputerName task sequence variable
- Detects if the last letter is an “A”
- Truncates the name to remove the “A”
- Re-sets OSDComputerName to the new value
'==========================================================================
' NAME: PCNameStandardization.vbs
' AUTHOR: Nick Moseley, <a href="http://t3chn1ck.wordpress.com">http://t3chn1ck.wordpress.com</a>
' COMMENT: This script will detect if the current computer name ends with ' the letter 'A' so that it can be removed.
'==========================================================================
Option Explicit
Dim oTaskSequence, sComputerName, iNameLength
Set oTaskSequence = CreateObject ("Microsoft.SMS.TSEnvironment")
sComputerName = ucase(oTaskSequence("OSDComputerName")) iNameLength = Len(sComputerName)
If right(sComputerName,1) = "A" Then
oTaskSequence("OSDComputerName") = left(sComputerName, iNameLength-1)
' The echo statement is not displayed, but rather registered in SMSTS.log
wscript.echo ">>>> Set OSDComputerName from " & sComputerName & " to " & oTaskSequence("OSDComputerName")
End If
To add this into your task sequence:
- Put this script into a package for your general OSD Scripts
- Ensure you have the step to capture the computer name

- Immediately after the capture windows settings, run the PC Standardization Script

- On whatever step you have that prompts for the PC Name, add a condition to not execute if variable OSDComputerName does not exist. This is so that task sequence will not be held up on the other end waiting for someone to enter a PC name for one you’ve already set.

- Finally – ensure ConfigMgr environment is configured to automatically resolve conflicting records! See this as to why http://t3chn1ck.wordpress.com/2013/02/14/error-initializing-client-registration-0×80040222/
Error initializing client registration (0×80040222)
Posted in ConfigMgr 07, Troubleshooting on February 14, 2013
I recently had a request from a customer to rename their PCs during an in-place upgrade of WinXP to Win7. I’ve put together some custom scripts to detect the particular qualifying conditions for when the PC needs to be renamed, and these scripts work just fine (this is an upcoming blog post).
The problem that I ran into was that after completion of the task sequence, the CM07 client was unable to register with the site server. Thereby it wouldn’t receive policies and did not operate. The client’s ClientIDManagerStartup.log showed “Error initializing client registration (0×80040222)”. As part of my troubleshooting, I was able to “fix” the client by deleting the old computer record instance and the generate a new GUID on the client.
Credit to one of my colleagues who was able to identify the scenario when I had overlooked it. The real problem was that since the PC was being renamed, a Conflicting Record was being created since both the old and new instance had the same hardware ID information. There are two ways to resolve this situation:
- Manually resolve the conflicting records
- Configure the site to automatically resolve the conflicting records
Option 2 is the most desirable since you can set it and forget it….so that’s we did!
Going to MMS 2013!
Posted in Miscellaneous Ramblings on February 7, 2013
I am glad to say that I am going to MMS 2013…
….BUT this time as a speaker! I’ve been a long time attendee to this fantastic conference, and now it is my privilege and honor to continue to give back to the community in this way.
Augmenting Your Windows Management Strategy with System Center 2012 Configuration Manager Task Sequences
Configuration Manager 2012 has simplified Windows management with the new Application model. However, some systems management challenges are too complex for any general-purpose tool. Come learn how to extend your coverage with Task Sequences to manage your Windows environment. We will cover scenarios detailing when to utilize Applications vs. Task Sequences, demonstrations of how to leverage the versatility of Task Sequences, as well as assorted community solutions.
MMS is the premier conference for learning and advancing in the System Center suite of products (amongst other things). I highly recommend attending if you can. Early bird registration ends next week, February 13th. If you do go, be sure to sign up for my session and say hi to me afterwards! http://www.2013mms.com/topic/details/UD-B303
VBScript Disable NIC Power Management Setting
Posted in ConfigMgr 07, ConfigMgr 12, Scripting on February 5, 2013
The following VBScript will disable NIC power save features.
'==========================================================================
' NAME: SetNetworkPnPCapabilities
' AUTHOR: Nick Moseley , Archstone
' COMMENT: Parses list of available network adapters to then disable power
' save features. For more info, see Microsoft KB837058
' VERSION HISTORY:
' 1.0 (05/09/2011) - Initial script
' 1.1 (05/10/2011) - Fixed logical bug within the If statement for Wan/Lan
' 2.0 (05/10/2011) - Added logging into registry for future inventory
' 3.0 (08/17/2011) - Commented out changes to disable NIC power save as
' this needs to be enabled in order to support WOL
'==========================================================================
Option Explicit
Const ForAppending = 8
Dim oShell, oWMI, colNetworkAdapterItems, sNetworkAdapterReg
Set oShell = CreateObject ("WScript.Shell")
Set oWMI = GetObject("winmgmts:\\.\root\cimv2")
Set colNetworkAdapterItems = oWMI.ExecQuery ("Select * from Win32_NetworkAdapter")
sNetworkAdapterReg = "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\"
' Logging
Dim oFSO, oVersionLog
Set oFSO = CreateObject ("Scripting.FileSystemObject")
Set oVersionLog = oFSO.OpenTextFile ("C:\Windows\Version.log", ForAppending, True)
oVersionLog.WriteLine "Configuration of Network Adapters"
oVersionLog.WriteLine " => Started (" & Date & " " & Time & ")"
' Get all objects and take action on network adapters
Dim oItem, sIndexValue, sLomValue
For Each oItem In colNetworkAdapterItems
If InStr(lcase(oItem.Name),"wan miniport")=0 _
And InStr(LCase(oItem.Name),"microsoft isatap")=0 _
And Trim(oItem.Name)<>"RAS Async Adapter" _
And InStr(LCase(oItem.Name),"cisco")=0 Then
If oItem.Index < 10 Then
sIndexValue = "000" & oItem.Index
Else
sIndexValue = "00" & oItem.Index
End If
' ****************************************
' IMPORTANT: NIC power save as needs to be enabled in order to support WOL
' Configure/disable Power save on NIC
oShell.RegWrite sNetworkAdapterReg & sIndexValue & "\PnPCapabilities", "56", "REG_DWORD"
oVersionLog.WriteLine " => Disabled network adapter power save on device """ & oItem.Name & """"
oVersionLog.WriteLine " Set PnPCapabilities (dword) to 38 in " & sNetworkAdapterReg & sIndexValue
' ****************************************
' Configure/enable WAN/LAN switching
sLomValue = ReadRegistryKey (sNetworkAdapterReg & sIndexValue, "LOM")
If sLomValue<>"1" And sLomValue<>"null" Then
oShell.RegWrite sNetworkAdapterReg & sIndexValue & "\LOM", "1", "REG_SZ"
oVersionLog.WriteLine " => Enabled WAN/LAN switching on device """ & oItem.Name & """"
oVersionLog.WriteLine " Set LOM (string) to ""1"" in " & sNetworkAdapterReg & sIndexValue
End If
End If
Next
' Set registry values for SCCM inventory
oShell.RegWrite "HKLM\Software\CompanyName\Image Info\DisabledNICPowerSave", "True", "REG_SZ"
' End
oVersionLog.WriteLine " => Completed (" & Date & " " & Time & ")"
WScript.Quit (oVersionLog.Close)
Function ReadRegistryKey (sReadKey, sReadValue)
On Error Resume Next
Dim sGetValue
sGetValue = oShell.RegRead (sReadKey & "\" & sReadValue)
If Err.Number <> 0 Then
ReadRegistryKey = "null"
Else
ReadRegistryKey = cstr(sGetValue)
End If
End Function






































Recent Comments