Import DHCP Scopes as SCCM Boundaries

A little tip that might save you some time.

If you are installing a SCCM 2012 environment at a customer, you will probably need to create Boundaries. It’s common to miss some IP subnets or misspell something 

These simple Powershell lines will export all Scopes from an DHCP server and import them as Boundaries

Step 1:

Install DHCP Server tools in Server manager

Step 2:

Export Scopes from DHCP server

Import-Module DhcpServer

Get-DhcpServerInDC

Get-DhcpServerv4Scope –ComputerName dhcpserver.fullfqdn.com | select ScopeID,Name | Export-csv C:\dhcpscopes.csv -encoding “unicode”

Step 3:

Remove the beginning lines in your CSV file

Step 4:

Create Boundaries. This will name Boundaries like this: “192.168.0.0 – Client PXE Network”

import module ‘D:\Program Files\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1’

$smsproviderloc = “select * from sms_providerlocation”

$sc = Get-WmiObject -Query $smsproviderloc -Namespace “root\sms” -ComputerName localhost

$sc = $sc.sitecode

cd $sc’:’

$CSVFile = “C:\dhcpscopes.csv”

Import-CSV $CSVFile -Header Name,Value | Foreach-Object {

$BoundaryName = $_.Value + ‘ – ‘ + $_.Name

New-CMBoundary -Name $BoundaryName -Type ‘IPSubnet’ -Value $_.Value

}

 

Posted in Powershell, SCCM, Scripting, System Center | Leave a comment

Windows 8.1 and OneNote Win+S not working!!!

After upgrading to Windows 8.1, you will experience that your favorite shortcut command in Microsoft OneNote (Take screen cliping) is not working anymore and has been replaces with Windows Search.

Now you can use the combination of Windows+Shift+S to get the screen cliping back again

If you don’t like the new combination, you can assign a new key through the registry by following this guide/link:

http://blogs.msdn.com/b/descapa/archive/2006/11/17/changing-the-onenote-screen-clipping-and-new-side-note-keyboard-shortcuts.aspx

 

Posted in Office, Registry, Windows 8.1 | Leave a comment

MSI Packaging of Java Runtime 1.7

Hi,

In this post I will contribute on how I make a good MSI package to deploy to my customers.

When there is a new version released, I will navigate to www.java.com/en/ in Internet Explorer. Then I push on “Free Java Download”. Push the link “See all Java Downloads”. You could also use this link:

http://www.oracle.com/technetwork/java/javase/downloads/index.html

Download “Windows x86 Offline” and save it in a temporary folder, like on the Desktop.

Execute the downloaded Exe-file and stop when the installation window pops up.

Open the folder “%appdata%\..\LocalLow\Sun\Java”

Copy the folder of the version of Java that you want to deploy, like in my case “jre1.7.0_45”

When the copy is done you can close the installation you had started.

In the folder you copied, you will have a Cab-file, a MSI-file and a MST-file. The rest of the files you can remove.

Rename the MST file 10XX.mst to Silent.mst

Open the MST file in InstallShield.

  • Under Additional Tools > Direct Editor
  • Open the table Property
  • Change AUTOUPDATECHECK to 0
  • Change JAVAUPDATE to 0
  • Change JU to 0

__________________________________________________________

If you want to uninstall Java 1.6

  • Add to SecureCustomProperties:  ;OLDPRODUCTS
  • Open the table Upgrade
  • Add a new Row:
    • UpgradeCode: {57BDA5C6-443C-4D65-B233-2823932160FF}
    • VersionMin: 0
    • VersionMax:
    • Language:
    • Attribut: 512
    • Remove: ALL
    • ActionProperty: OLDPRODUCTS
  • Open the table InstallExecuteSequence
  • Add to RemoveExistingProducts:  Or OLDPRODUCTS

__________________________________________________________

  • Open Behavior and Logic > Custom Actions and Sequences
  • Rightclick on “Custom Actions” and choose “New EXE > Path referencing a directory”
  • Use these values:
    • Name: CloseRunningApps
    • Working Directory: SystemFolder
    • Command Line: taskkill.exe /F /IM iexplore.exe /IM jqs.exe /IM firefox.exe /IM java.exe /IM javaw.exe /IM javaws.exe
    • Change “Return Processing” to “Synchronous (Ignores Exit Code)”
    • Change “Install Exec Sequence” to “After CostFinalize”.
  • Rightclick on “Custom Actions” and choose “New EXE > Path referencing a directory”
  • Use these values:
    • Name: DeleteShortcuts
    • Working Directory: SystemFolder
    • Command Line:

cmd.exe /C rmdir “%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Java” /S /Q

  • Change “Return Processing” to “Synchronous (Ignores Exit Code)”
  • Change “Install Exec Sequence” to “After InstallFinalize”
  • Change “Install Exec Condition” to “NOT INSTALLED” so it only executes during installation.
  • Open System Configuration > Registry
    • Choose the component jz
    • Create HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Update\Policy
      • Create REG_DWORD EnableAutoUpdateCheck with the value 0
      • Create REG_DWORD EnableJavaUpdate with value 0
    • Create HKEY_LOCAL_MACHINE\Software\JavaSoft\Auto Update
      • Create REG_SZ AUVersion with no value/data
  • Open Organization > Setup Design
    • Create a new Feature named CompanySettings
    • Make it requiered and not visible
  • Open Application Data > Files and Folders
    • Choose your feature in the list (CompanySettings)
    • Create a new folder under[ProgramFilesFolder]\Java\jre7 named lib
    • Add your deployment.properties file to that lib folder. Choose to add the file “In a new CAB file”
    • Make deployment.properties to a Key File by rightclick on it and choose Key File

Sample of deployment.properties

deployment.expiration.check.enabled=FALSE
deployment.insecure.jres=PROMPT
deployment.javaws.associations=3
deployment.javaws.autodownload=NEVER
deployment.javaws.autodownload.locked
deployment.javaws.shortcut=NEVER

The deployment.properties should be in the lib folder or in a subfolder to the Windows directory. The user will then inherit these settings.

Save your MST file. The installation is now ready for testing. As a test I will create a silent.bat in the same folder with this content:

msiexec.exe /I “%~dp0jre1.7.0_45.msi” /qb REBOOT=ReallySuppress TRANSFORMS=”%~dp0Silent.mst”

Some of the key points in this package is that I close running process to avoid computer restarts and I create a registry key that usually is missing and causing the Java Control Panel app to not start and I add a deployment.properties file that will suppress the check for Expired releases and causing popups to be displayed for the end user.

Posted in Application Packaging, Customization, Scripting | Leave a comment

Startmenu in Windows 8 or not?

I have heard that lots off people are missing the startmenu in Windows 8. I don’t miss it because I normally use the “Run” to enter my command/application and I have pinned my mosy used apps in the taskbar.

What I do recommend to my customers is to start using Windows+X. In Windows 7 this would open the Mobility center, but in Windows 8 this opens a smal menu in the bottom left corner:

winx

This provides a lot of options for the most. But if you still miss the startmenu and don’t like the new one, I would recommend Classic Shell (http://www.classicshell.net/).  This installs a startmenu that you could customize after your needs. If you like the Windows XP look, then just change to that skin.

All settings are stored per user in the registry under HKCU\Software\IvoSoft\ClassicStartMenu

This is a screenshot of my startmenu with Windows 8 look. Notice that is has two folders, one for the Windows 8 apps and one for the classic apps:

classicstartmenu

 

 

Posted in Customization, Microsoft, Registry, Windows, WIndows 8 | 1 Comment

SCCM, Collections and Applications

After you have deployed some apps to your computers, you would probably end up with having to upgrade some of your apps.

Maybe you use scripts to do a lot of the work, but I like to distribute an application only to those that needs it.

I will now show you how I build a collection in SCCM with computers that has an application with the wrong version or not the program installed at all.

I will create a collection for Adobe Flash Player ActiveX 11.5.502.146 so it contains both the computers with older versions and those that doesn’t have it installed at all. I will limit it to Windows 7 computers.

My collection will have two queries.

Some of you might think this is easy and have a collection with one query containing this question:

SELECT * FROM …. WHERE Add_Remove_Programs.DisplayName like “Adobe Flash Player%ActiveX” and Add_Remove_Programs.Version < “11.5.502.146”

That query will not be a correct query. A query will compare each number, for example. If you compare 12.x with 9.x, that means you compare number 2 and number 9 (2<9). In this case number 9 is bigger than number 2. This query will not have members that doesn’t have the application installed at all.

So to build a correct query for version 11.5.502.146 I will write this query first:

select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType, SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier, SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceId where (SMS_G_System_ADD_REMOVE_PROGRAMS.Version like “[0-9].%” or SMS_G_System_ADD_REMOVE_PROGRAMS.Version like “10.%” or SMS_G_System_ADD_REMOVE_PROGRAMS.Version like “11.[0-4].%” or SMS_G_System_ADD_REMOVE_PROGRAMS.Version like “11.5.[0-4]%” or SMS_G_System_ADD_REMOVE_PROGRAMS.Version like “11.5.50[0-1].%”or SMS_G_System_ADD_REMOVE_PROGRAMS.Version like “11.5.502.1[0-3]%”) and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like “Adobe Flash Player%ActiveX” and SMS_R_System.Active = 1 and SMS_R_SYSTEM.OperatingSystemNameandVersion = “Microsoft Windows NT Workstation 6.1”

This query will find all computers with older versions of the app, all version from:

  • 0.% to 10.%
  • 11.0% to 11.4&
  • 11.5.0% to 11.5.4%
  • 11.5.500.% to 11.5.501.%
  • 11.5.502.10% to 11.5.502.13%

The second query I will make is to find all Windows 7 computers that doesn’t have the Adobe Flash Player ActiveX installed at all.

select SMS_R_SYSTEM.ResourceID, SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name, SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup, SMS_R_SYSTEM.Client From SMS_R_System inner join SMS_G_System_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceId inner join SMS_G_System_COMPUTER_SYSTEM on SMS_G_System_COMPUTER_SYSTEM.ResourceId = SMS_R_System.ResourceId where SMS_R_System.Name not in

(select distinct  SMS_R_SYSTEM.Name From SMS_R_SYSTEM inner join SMS_G_System_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_SYSTEM.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like “Adobe Flash Player%ActiveX” ) and SMS_R_SYSTEM.Active = “1” and  SMS_R_SYSTEM.OperatingSystemNameandVersion = “Microsoft Windows NT Workstation 6.1”

This query finds all computers with Adobe Flash Player ActiveX installed and because of the “Where SMS_R_System.Name not in”, you will get the computers not having it installed.

The queries I have here is WQL, so you can use them in SCCM.

I hope I made it a little bit clearer on how to build a correct collection in SCCM.

Posted in SCCM, System Center | Tagged , | Leave a comment

Google Chrome in App-V and the Desktop shortcut…

For us that has made an App-V package of Google Chrome browser have seen that Google Chrome are creating an shortcut on the Desktop on the launch of the browser.

One way to remove this shortcut is to add a Post Script:

<SCRIPT EVENT=”SHUTDOWN” PROTECT=”FALSE” TIMING=”POST” WAIT=”FALSE” EXTERN=”TRUE”>

<SCRIPTBODY LANGUAGE=”Batch”>del /S /Q “%UserProfile%\Desktop\Google*”</SCRIPTBODY>

</SCRIPT>

But from version 23.x there is a new parameter you can use: –disable-desktop-shortcuts

Posted in Application Packaging, Application Virtualization | Leave a comment

Cisco VPN in Windows 8

When I installed Windows 8 I had som problems with my Cisco x64 5.x VPN client. You will receive an error message when trying to connect to a site saying “failed to enable virtual adapter”.

There is a thread on technet about this: http://social.technet.microsoft.com/Forums/en/W8ITProPreRel/thread/fe19ec2e-d1f3-4ffd-b9a5-1fdf464fcd32

The fix is to update the registry key DisplayName under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CVirtA

ciscovpn

 

Posted in Customization, Registry, Uncategorized, WIndows 8 | Tagged , | Leave a comment

Windows 8 / IE10 and Sharepoint Open in Explorer

Have been running Windows 8 for a while now and last weekend I was using Sharepoint and wanted to use the feature “Open in Explorer”. This didn’t work as expected, seems to be the same problem as in Windows 7 and IE9 with full FQDN sites.

I first tried with adding the Registry key AuthForwardServerList under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters and restarted the service Webclient and restarted internet Explorer but I still had this issue.

Then I found another tip from Google. In AuthForwardServerList, you usually just enter the FQDN address once, but in this case you write the same address twice. Then the “Open in explorer” worked 🙂

 

Posted in Customization, Internet Explorer 10, Registry, WIndows 8 | Tagged , , | Leave a comment

XenApp 6 Rollup Pack 2 Released

Finally the Rollup Pack 2 was released for XenApp 6: http://support.citrix.com/article/CTX133882

Not so much of extra features, just a lot of fixes included 🙂

Posted in Citrix | Tagged , | Leave a comment

Domain trust lost and no local account enabled?

At some customers I see a problem occasionally with Windows 7 loosing the domain membership and users can’t login.

There is a lot of things you can try, but the easiest way is usually to remove the machine from the domain and then re-join it.

But as many organizations wants to secure their environment, they might randomize the local administrators password and disable it. Then we have a problem….

But an easy way to enable the account and reset the password is to use Trinity Rescue Kit. Just download the ISO from http://trinityhome.org and burn it to a CD-R, boot from the CD and a Linux distribution is starting up in Live mode. You will then be presented with an easy menu of choices where you will find “Windows password resetting”.

There is other great stuff on this CD as well, like a file commander, file server and a virus scanner. Let’s say your OS has crashed an you want to save your files, just enable a temporary file server and browse the share from another computer on your network and copy everything.

Posted in Microsoft, Windows 7 | Leave a comment