Tuesday, May 24, 2011

SCCM 2007 R2 - Create Dynamic collections based on string in computer name

Here is the query which you can use for creating Dynamic Computer Collection based on string inside the computer name.

Example: If your computers contain WKS string in computer name:

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_SYSTEM on SMS_G_System_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_SYSTEM.Name like "%WKS%" order by SMS_R_System.Name

Tuesday, May 3, 2011

Allowing Non-Admin Users To Install Fonts in Windows 7

Installing Fonts for Standard Users in Windows XP was very easy. Modifying NTFS folder permissions and giving users modify permissions allow they to copy fonts into C:\Windows\Fonts and after that use them.

Installing Fonts in Windows 7 for standard user is different story and it could be very complicated.

Modifying NTFS Permissions on C:\Windows\Fonts  is not possible because Fonts is a System folder and right click on Fonts folder doesn't give possibility for direct NTFS permissions changes.


To change System folder properties attrib command can be used:

attrib -r -s %systemroot%\fonts

-r  - clears Read-only file attribute
-s  - clears System File attribute



Next step is take ownership of Fonts Folder and all files into this folder.

Example: To give Administrators group Ownership to Fonts folder takeown command can be used:

takeown /F %systemroot%\fonts\ /A

/F - Specifies the filename or directory name pattern. Wildcard * can be used to specify the pattern.
/A - Gives ownership to the administrators group instead of current user



Next Step is to change NTFS permissions on Fonts Folder and give Modify or Full permissions to users or groups. To do that you should use cacls command: 

Example:

cacls %systemroot%\fonts /E /G Users:F

/E - Edit ACL instead of replacing it.
/G - Grant specific user rights (in this example it gives Full permissions to Users group)
Note: This command changes Fonts Folder permissions and doesn't inherit permissions to the files into the folder.

You can copy all these three lines in Notepad and save it as bat file.

attrib -r -s %systemroot%\fonts
takeown /F %systemroot%\fonts\ /A
cacls %systemroot%\fonts /E /G Users:F

Next Step is to modify permissions on
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts
and to give Full Permissions to Users. This will allow standard users to register fonts in registry.



Next step is to copy your fonts in C:\WINDOWS\FONTS Folder. Here is the vbs script which can copy and in same time register your fonts. Fonts are located on network share and before to execute you should modify the script with fonts names.

' ****************************************************************************
' Copy Fonts From Network Share To C:\WINDOWS\FONTS Folder Of Workstation
' ****************************************************************************
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "xcopy.exe ""\\%SERVERNAME%\%SHARE \FONTS"" ""C:\windows\fonts"" /C /I /S /E /H /Y /Q", 1,True

' ****************************************************************************
' Imports The Registry Information For The New Fonts - Add A New Line For Each New Font
' Example : WshShell. RegWrite"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts\%FONT REG KEY%", "%FONT REG KEY ENTRY%", "REG_SZ"
' ****************************************************************************

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell. RegWrite"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts\Twiggy-Bold (TrueType)", "Twiggy-Bold.ttf", "REG_SZ"
WshShell. RegWrite"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts\Twiggy-Light (TrueType)", "Twiggy-Light.ttf", "REG_SZ"
' ****************************************************************************

Saturday, April 23, 2011

Hyper-V: An error occurred while attempting to export the virtual machine.

When you try to export Hyper-V Virtual machine to network share you get this error:

An error occurred while attempting to export the virtual machine. 
Failed to copy file during export.
General access denied error (0x80070005)


Solution:
Computer account of Hyper-V host should have permissions on NTFS and share level to write to target network share:

NTFS permissions:

1.  On the destination server, Right-click on the shared folder and select Properties. 
2.  Select the Security tab. 
3.  Click Edit button and click the Add button in the permissions dialog box. 
4.  Click Oject Types and select Computers if not already done and click OK.
5.  In the dialog "Enter the object names to select" provide the name of Hyper-V host machine and click Check Names.
6.  With the Hyper-V host machine name select, click Allow by "Full control" and click OK.

Share  permissions:

1.  On the destination server, Right-click on the shared folder and select Properties. 
2.  Select the Sharing tab. 
3.  Click Advanced Sharing...
4.  On the Advanced Sharing dialog, click Permissions  and then Add.
5. Click Oject Types and select Computers if not already done and click OK.
6.  In the dialog "Enter the object names to select" provide the name of Hyper-V host machine and click Check Names.7.  With the Hyper-V host machine name select, click Allow by "Full control" and click OK.

Thursday, April 21, 2011

Hyper-V: The operation cannot be performed while the object is in its current state.

This message appears when you try to delete Virtual Machine from Hyper-V Manager:

The operation cannot be performed while the object is in its current state.

If you go manually to delete the folder where is VM located you will get an error message that you don't have permissions to do that. Into this folder there is config XML file:



Solution for this issue is to find the same XML file in :

C:\ProgramData\Microsoft\Windows\Hyper-V\Virtual Machines

and to delete it.
Note: First you should enable: Show hidden files, folders and drives in Folder Option. 




After that when you open Hyper-V Manager you will see that the machine is gone.

Tuesday, March 29, 2011

Enable WINDOWS 7 Administrator Account with Group Policy (GPO)

Administrator account is disabled by default on Windows 7.
Group Policy can be used to enable it.
Create a new GPO and go to: Computer configuration -> Policies -> Windows Settings -> Security Settings -> Security Options. On Right Pane click on Accounts: Administrator account status and change the settings to Enabled.


To enter a password for the Local Administrator Account, Group Policy Preferences can be used:

Go to Preferences -> Control Panel Settings -> and right click on Local Users and Groups. Choose: New -> Local User. From Drop-down menu on User name choose: Administrator (built-in).
Put the password and confirm it.




Wednesday, March 9, 2011

FLEXlm license finder issue

During customization of 3ds Max 2009 Software Package for Network deployment described on AutoDesk web site (http://usa.autodesk.com/adsk/servlet/ps/dl/item?siteID=123112&id=14195309&linkID=9241177), Network License Server has been configured:


But after the installation when 3ds Max has been started, from some reason the value for Network License Server previously configured in Network deployment package is not accepted, FLEXlm license finder pop-up and ask for License File or License Server.



Solution for this can be adding System Environment variable ADSKFLEX_LICENSE_FILE with the value of @SERVERNAME and deploying on the workstations using GPO Preferences.

@SERVERNAME - is the name of your Network License server

Tuesday, March 8, 2011

Deploying 3ds Max 2009 using SCCM 2007 R2

Creating of Customized Network deployment of 3ds Max is described on AutoDesk web site:

http://usa.autodesk.com/adsk/servlet/ps/dl/item?siteID=123112&id=14195309&linkID=9241177

When the creation of Network Deployment is done a shortcut 3dsmax_2009.ini is created.


Click on it will allow 3ds Max to be installed in silent mode (if silent mode is specified during network deployment creation).

This shortcut points to the subfolder AdminImage which call setup.exe, use switch /I and 3Dsmax_2009.ini file created by Network deployment procedure.

setup.exe /I 3Dsmax_2009.ini

Note:
setup.exe and 3dsmax_2009.ini contains network UNC path where they are physically located.

\\server\share\3dsmax_2009\AdminImage\setup.exe /I \\server\share\3dsmax_2009\AdminImage\3dsmax_2009.ini

Using this syntax  SCCM package can be created and 3ds Max 2009 will be successfully deployed: