Thursday, April 28, 2011

User logon to Windows using always a temporary profile

Problem: When a user logon to Windows 7 or Windows 2008, it always get a temporary profile. Removing the user folder under c:\users and rebooting the machine does not solve the problem.

Resolution:

0) Logon with an administrator account and backup the whole content of the folder c:\users\myuser where "myuser" is the username of the user who reported the problem.

1) Find the SSID of the user with problem. Open regedit and go to:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\Cu rrentVersion\ProfileList

Click on any of the key on the left and check out the right pane for the ProfileImagePath value. Now you should find something like this: c:\users\myuser, where "myuser" is the name of the account associated with the SID you selected in the left pane.

2) Probably you will find that above or below the SSID you found in step 1, there is a folder with the same SSID but with a .bak extension. Delete both folders (the one with the .bak extension and the other that does not have it).

3) Logoff from the administrative account and logon again with the credentials of the user having the problem. This will create a new empty and healthy profile for the user. Check at the registry path above that no .bak folder was created for that user. Logoff.

4) Logon with an administrator account and restore the backup you made at step 1 to the folder c:\users\myuser where "myuser" is the username of the user who reported the problem. Logoff and ask your user to try again.

Note: I have seen this problem in Windows 7 and Windows 2008 but probably could occur in old versions of Windows. Just take into account that the location of profiles in Windows XP and older  is c:\documents and settings.

Wednesday, April 27, 2011

How to rotate a text in Word

I was trying to rotate a text inside a cell in a table so the text looks like being seen in a mirror. The easiest way I found was to use a Word Art form inserted in the cell and modify its properties. For more information about how to insert Word Art forms and modify its properties, check this link:
http://support.microsoft.com/kb/312802

Thursday, April 14, 2011

How to split a PDF file by bookmarks and use them as names for the resulting files

There is a wonderful tool to split PDF files. Its name is PDF Sam and it can be downloaded from this link: http://www.pdfsam.org/?page_id=32. And yes, it is free!. It runs on Windows /Mac and needs java.
One of the most interesting features is its ability to split the files by bookmarks and use the bookmarks as names for the resulting files. However, this feature is not so obvious to configure in the application and this can lead to the wrong idea that the tool cannot do such task.
In order to configure PDF Sam to do what I mention above, you need to type [BOOKMARK_NAME] near to the Output Options section at the main screen. Take a look to the image below to see where you can find the settings I am talking about.
There are another options you can use for Output Options and the list are available at the following link: http://www.pdfsam.org/mediawiki/index.php?title=HowTo:ConsoleComplexPrefixConfigure.
Enjoy.

Wednesday, April 13, 2011

How to query active directory from SQL Server

There are two ways to query Active Directory from SQL Server. The easiest way for me is using OPENROWSET as explained below:

1) you need to run the following SQL sentences just one time

USE [master]
GO
sp_configure 'show advanced options',1
GO
reconfigure with override
GO
sp_configure 'Ad Hoc Distributed Queries',1
GO
reconfigure with override
GO

2) After running the senteces above, execute a query like the one below:

SELECT  * from OPENROWSET
('AdsDsoObject' ,
'User ID=domain\user;Password=myuserpassword;ADSI Flag=0x11;Page Size=10000',
'SELECT sn,givenName,mail FROM ''LDAP://OU=myOU,DC=myDomain,DC=com'' where ObjectClass=''User'''



)
wheremail is not null and
givenname is not null and
sn is not null and
order by mail

Take into account that:
  • domain\user is an account that can read the Active Directory and mypassword is the password for that account
  • ADSI Flag=0x11 is some type of authentication flag for ADSI (I really don´t know what flag can be)
  • The second SELECT sentence is the one you use to specify what domain and OU is you quering from. Inside this SELECT you can specify the type of object you need, for example, an User or a Computer. The objectclass="User" part of the inner select do that trick.
  • In all the sentence we never use quotation marks (") to enclose the text. The simbols are more like apostrophes.
  • You can include a WHERE clause at the end of the outer select but only to filter the results provided by the inner one
  • You can find a list of LDAP atributes in the following link: http://www.computerperformance.co.uk/Logon/LDAP_attributes_active_directory.htm

Thursday, April 7, 2011

Offline files service error: The system cannot find the path

Problem: we need to enable offline files in a windows 2008 r2 workstation. Starting the Offline files service only shows the error "The system cannot find the path".

Solution: the procedure to enable offline files in windows 2008 is documented in the following link http://www.win2008workstation.com/win2008/enable-offline-files-feature. Just in case the URL is broken anytime in the future, I am copying the most important part below:

Prerequisite: You must have the Desktop Experience feature installed.

1. Download and install the appropriate version of Windows Mobile Device Center from http://www.microsoft.com/windowsmobile/devicecenter.mspx. This doesn’t have to do with any Windows Mobile device, but it is needed to get the Sync Center option in the Control Panel.

2. In the Start menu click Control Panel.

- If you use the Modern View, click the Network and Internet section and click Enable offline Files.

- If you use the Classic View, doubleclick the Offline Files icon.

In the Offline Files window click Enable Offline Files to start using offline files.

3. Close the Enable Offline Files window by clicking OK and choose Yes when asked if you want to restart your Computer.

4. After the restart go to the networking folder you want to make offline available, right click on it and select Always Available Offline. A local copy will now be made.

Preem Palver´s note: after installing the 64 bit version of the Mobile Device Center, I got a message saying that there was an error installing the driver. However after rebooting the machine it worked fine.