Page 1 of 1 1
Topic Options
#187528 - 2008-05-08 05:03 PM NTUSER.DAT
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
Is there anyway within KiX to read the NTUSER.DAT of a user?

Example Joe Smith calls the help desk with a problem that requires a reg edit. Can I read/write the NTUSER.DAT of Joe Smith?
_________________________
Today is the tomorrow you worried about yesterday.

Top
#187532 - 2008-05-08 10:11 PM Re: NTUSER.DAT [Re: Gargoyle]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
No - you don't directly manage that file.

Look here for further information on the subject.

Registry structure

User profile

NT 4 article but for the most part applies to newer OS as well
Modifying Ntuser.dat Hive So New Users Get Defined Settings

You can also look here where there was a little bit of discussion about it a few years ago.
Channel 9 ntuser.dat


Only method I know of is using a Registry Editing Tool

Top
#187534 - 2008-05-09 02:15 AM Re: NTUSER.DAT [Re: NTDOC]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
That is what I was afraid of. I had looked at the MS articles, and that didn't really help.

One scenario that has been brought up by our help desk is that profiles get corrupted from time to time and they want to be able to extract from the user's current NTUSER.DAT their printer connections, and then put them into a new and clean NTUSER.DAT

Given that, the user may or may not be logged in, and they never remember what printers they had mapped to begin with.
_________________________
Today is the tomorrow you worried about yesterday.

Top
#187535 - 2008-05-09 09:44 AM Re: NTUSER.DAT [Re: Gargoyle]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Just write a mini script that exports customization settings of the user to a Network drive or in another folder on the C: volume

Or you could run an inventory script that would have all that information.

Not sure why you get corrupted profiles though. I think I've ran into maybe 2 bad profiles in my entire time working on computers.

Top
#187539 - 2008-05-09 02:14 PM Re: NTUSER.DAT [Re: NTDOC]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 687
Loc: Maryland, USA
You can just mount it to a temporary location such as:

 Code:
$intSelect = LoadHive("HKEY_USERS\Temp","\\path\to\desired\ntuser.dat")
If $intSelect = 0
   ; Get printer info.
   $strDefP = ReadValue("HKEY_USERS\Temp\Software\Microsoft\Windows NT\CurrentVersion\Windows", "Device")
   $strDefP = Substr($strDefP,1,Instr($strDefP,",")-1)
   $intErr = WriteProfileString($strFile,"Printers","Default",$strDefP)
   $intSelect = 0
   $intIndex2 = 0
   $strKey = EnumKey("HKEY_USERS\Temp\Printers\Connections", $intSelect)
   While @Error = 0
      ReDim Preserve $arrMap[1,$intIndex2]
      $temp = Split($strKey,","4)
      $arrMap[0, $intIndex2] = $temp[2]
      $arrMap[1, $intIndex2] = $temp[3]
      $intErr = WriteProfileString($strFile,"Printers",$arrMap[0, $intIndex2],$arrMap[1, $intIndex2])
      $intIndex2 = $intIndex2 + 1
      $intSelect = $intSelect + 1
      $strKey = EnumKey("HKEY_USERS\Temp\Printers\Connections", $intSelect)
   Loop
   $intSelect = UnLoadHive("HKEY_USERS\Temp")
   If $intSelect <> 0
      ? "Open regedit and check HKEY_USERS\Temp.  It was not unloaded."
   EndIf
Else
   ? "Could not load the hive, ..."
EndIf


Note that it probably won't work if it is in use. I think you can make a copy first and then load it.

I just saw that you were trying to retrieve printer info. I wrote a script to do that (among other things). I've added that in here. I had to re-type. So, I hope I didn't make any typos! \:\)

Regards,

Brad V


Edited by BradV (2008-05-09 02:27 PM)

Top
#187540 - 2008-05-09 05:04 PM Re: NTUSER.DAT [Re: BradV]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
Brad, thanks.
I don't know how many times I have looked at the manual and just not seen that command.

Doc, this goes back to the "missing icons" question. This is the only thing that we have come up with to fix it.
_________________________
Today is the tomorrow you worried about yesterday.

Top
#187542 - 2008-05-09 09:01 PM Re: NTUSER.DAT [Re: BradV]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Thanks for the Script Brad

Garg,

If the profile is corrupted though then not sure what good it would do to try to access the NTUSER.DAT after the fact. I would think it is the cause of the corruption issue. So exporting, saving the data locally or on a server while the system is working would seem more prudent than trying to discover information after it's dead.

Top
#187546 - 2008-05-10 01:05 AM Re: NTUSER.DAT [Re: NTDOC]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
Doc,

It is a definite possibility to go that route. I have to look at the logistics of how to manage that data and go from there.
_________________________
Today is the tomorrow you worried about yesterday.

Top
#187569 - 2008-05-12 03:13 PM Re: NTUSER.DAT [Re: Gargoyle]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 687
Loc: Maryland, USA
This is part of a larger script I wrote for getting information out of ntuser.dat after it has been corrupted. The usual method of fixing here is to move the current personal folder to a different name and create a new one. So, we usually wind up with several old ntuser.dat files laying around. I first go into their home directory and search for all ntuser.dat files. I then present this list and query which one to examine. The script then mounts that ntuser.dat file and pulls out as much information as possible. I read drive mappings, printers, color schemes, wall paper, screen saver among others.

Usually I can find whatever is needed. Quite often one of the other admins would just create a blank new ntuser.dat file for the person and would leave. If I get called in later and the customer says, "I can't find my G drive." I could ask "What was G mapped to?" and would usually just get, "I don't know. It was my G drive!" So, I just run my script and look next oldest ntuser.dat file beyond the current one and see if the G drive is mapped there, etc.

Regards,

Brad V

Top
#187571 - 2008-05-12 06:29 PM Re: NTUSER.DAT [Re: BradV]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Well I'm still curious why so many failed/corrupted profiles for you guys. I've been doing support long before NT was even on the desktop and have even ran Back Office Automation support that had to deal with thousands of computers and in all that time even up to this day I can only recall a couple of corrupted profiles.

What are you guys running your systems on that has such dismal reliability?

Is anyone else running in to high numbers of corrupted profiles?

Top
#187575 - 2008-05-12 09:53 PM Re: NTUSER.DAT [Re: NTDOC]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
Well we are running our TS farm on Dell 2850's and the backend Filer is a NetApp. Each of the servers have at least a 2GB channel back to the filer. I would really like to find the root cause behind the corruption, but to this point we have been unable to find any commonalities.
_________________________
Today is the tomorrow you worried about yesterday.

Top
#187598 - 2008-05-13 01:36 PM Re: NTUSER.DAT [Re: NTDOC]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 687
Loc: Maryland, USA
Hi Doc,

I think most of the corruption happens because users with a w2k profile wind up logging in to xp computers and vice-versa. Now they are talking about trying to put Vista into the mix! \:\)

Regards,

Brad V

Top
#187619 - 2008-05-14 02:45 AM Re: NTUSER.DAT [Re: BradV]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Hi Brad,

Are these ROAMING profiles then that you're speaking of?

We also have all types of logons but we do not use Roaming profiles (PITA to me - slow and problematic even on a fast network)
If that's the case then maybe that is what is in common.

Top
#187621 - 2008-05-14 04:02 AM Re: NTUSER.DAT [Re: NTDOC]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
Mine are terminal server profiles (might as well be considered roaming). So you may have something there Doc.
_________________________
Today is the tomorrow you worried about yesterday.

Top
#187632 - 2008-05-14 12:55 PM Re: NTUSER.DAT [Re: Gargoyle]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 687
Loc: Maryland, USA
Yes - roaming. The facility is aggressively changing out w2k computers for xp and updating users profiles. However, they are already starting transition to vista, so I don't think the corruption problem will go away any time soon.

Regards,

Brad V

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.084 seconds in which 0.039 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org