?
Solved

User Information

Posted on 2005-03-07
12
Medium Priority
?
352 Views
Last Modified: 2007-12-19
I'm writting up some documentation right now to help users that have basic knowledge of windows to find out what type of account they are logged in as. Is there anyway through javascript or any other web based way of displaying this information to them?

Or is there a simple way the user can find out what type of account they have (and possibly other information)?
0
Comment
Question by:Shroder
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 3
  • +1
12 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 13482917
Hi Shroder,
> what type of account they are logged in as

I don't understand what you mean.  Are you talking about a local account versus a domain account, or ... what?

Cheers!
0
 

Author Comment

by:Shroder
ID: 13482953
Sorry for being so general. I'm talking about local permissions.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 13482960
Shroder,
> local permissions
You mean local NTFS permissions, or all the rights the person has on the local machine, like the ability to log on locally and so forth?
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 34

Expert Comment

by:sramesh2k
ID: 13483609
Shroder,

Open a Command Prompt windows (CMD.EXE) and type this:

NET USER <USERNAME>

To output the results to a file

NET USER <USERNAME> >C:\Accnt.txt

This fix will have all the information about that user account.
0
 
LVL 6

Accepted Solution

by:
Wallsy earned 2000 total points
ID: 13485007
Here's a snippet out of our PC helpdesk web page. I'm not too good with this stuff, but hopefully it's enough to get you started...

HTH,

Wallsy



Sub ShowTableUserEnvironment()
Dim strHTML
Dim objItem
Dim objSysInfo
Dim objGroup
Dim x

On Error Resume Next

      ' Generate the default table            
      strHTML = GenTablePref()
      
      strHTML = strHTML & GenHeader(gstrHeadLine)
      Set objSysInfo= CreateObject("ADSystemInfo")      
      
      Set objItem= GetObject("LDAP://" & objSysInfo.UserName & "")
      
      strHTML = strHTML & GenLine( "Account Name" , objItem.Get("sAMAccountName"))
      strHTML = strHTML & GenLine( "Full Name" , objItem.FullName)
      strHTML = strHTML & GenLine( "LDAP User Name" , objSysInfo.UserName)
      
      If Len(objItem.HomeDirectory) Then strHTML = strHTML & GenLine( "Home Directory Path" , objItem.HomeDirectory)
      strHTML = strHTML & GenLine( "Home DirectoryDrive" , objItem.Get("homeDrive"))
      strHTML = strHTML & GenLine( "Profile" , objItem.Profile)
      strHTML = strHTML & GenLine( "Script Path" , objItem.Get("scriptPath"))
      strHTML = strHTML & GenLine( "Password Expires" , objItem.PasswordExpirationDate)
      
      If objItem.Groups Is Nothing then
            ' No Groups determined
      Else
            x=0
            strHTML = strHTML & GenBldLine( "Group Membership" , "")
            For Each objGroup In objItem.Groups
                  x = x+1
                  strHTML = strHTML & GenLine( "Group " & x , Replace(objGroup.Name,"CN=",""))
            Next
      
      End if      
      
      strHTML = strHTML & GenTablePost()      
      objTable.innerHTML = strHTML
      
      Set objSysInfo = Nothing
      Set objItem = Nothing
      Set objGroup = Nothing
      Set objReg = Nothing
      Set gobjWMIService = Nothing  

End Sub

Function GenTablePref()

      GenTablePref = "<form id='Configuration'>"
      GenTablePref = GenTablePref & "<table cellSpacing='0' cellPadding='5' border='0'class='styleTblHeader'>"
      
End Function

Function GenHeader(ByVal strName)

       GenHeader = "<tr><td colspan='2' nowrap class='styleTblHeadColumn' height='40'>" & strName & "</td></tr>"
       
End Function

Function GenLine(ByVal strDesciption, ByVal strValue)

       GenLine = "<tr>"
       GenLine = GenLine & "<td nowrap class='styleTblLabel' height='30'>" & GetLocStr(strDesciption) & "</td>"
      GenLine = GenLine & "<td nowrap class='styleTblValue'>" & strValue & "&nbsp;</td>"
      GenLine = GenLine & "</tr>"
      
End Function

Function GenBldLine(ByVal strDesciption, ByVal strValue)

       GenBldLine = "<tr>"
       GenBldLine = GenBldLine & "<td nowrap class='styleTblBldLabel' height='30'>" & GetLocStr(strDesciption) & "</td>"
      GenBldLine = GenBldLine & "<td nowrap class='styleTblBldValue'>" & strValue & "&nbsp;</td>"
      GenBldLine = GenBldLine & "</tr>"
      
End Function

Function GenTablePost()

      GenTablePost = "</table>"
      GenTablePost = GenTablePost & "</form>"
      If bShowButton Then
            GenTablePost = GenTablePost & "<input id='cmdOK' type='button' value='  Close  ' onClick='CmdCloseWindow()'><br>"
      End If
      GenTablePost = GenTablePost & "<br><span class=""styleDocFooter"" id=""styleDocFooter"">(c) 2004 DaimlerChrysler AG</span>"
      
End Function


0
 

Author Comment

by:Shroder
ID: 13486810
Sorry for my ignorance. Can I use that as vbscript?
0
 
LVL 76

Expert Comment

by:David Lee
ID: 13491512
Shroder,

You can separate the HTML from the VBScript and use the VBScript portion.  Also, if you can be more specific about exactly what pieces of information you want, then it's possible that the experts might be able to supply you with a script that'll provide exectly, or at least more closely, what you're looking for.
0
 

Author Comment

by:Shroder
ID: 13493030
Actually if I can get part of your snippet to work I can figure out the rest.

I'm getting the following error:
"No mapping between account names and security IDs was done"
using the following code:

<script LANGUAGE='VBSCRIPT'>
Dim objSysinfo
Dim objItem
Set objSysinfo = CreateObject("ADSystemInfo")
MsgBox objSysInfo.UserName
</script>
0
 
LVL 6

Expert Comment

by:Wallsy
ID: 13497190
More information on the ADSystemInfo object is at:
http://www.microsoft.com/technet/community/columns/profwin/pw0602.mspx

As I mentioned earlier, I'm not actually terribly good at this... I've just copied and pasted! As fas as I know it will only work on domain members, but someone else will probably be able to help you much more than that.

Sorry!

Wallsy
0
 

Author Comment

by:Shroder
ID: 13502938
No problem. :) Thanks for the help so far.
0
 

Author Comment

by:Shroder
ID: 13636648
Looks like that is suppose to work. It has problems with XP SP 2 though.
0
 
LVL 6

Expert Comment

by:Wallsy
ID: 13660351
Thanks for the points - sorry I couldn't be more helpful though...

Cheers,

Wallsy
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are 2 things you must have in order to connect to the internet behind a router, The "Gateway IP" of the router, which is usually something like 192.168.xxx.1, I've seen routers with default values of: 192.168.0.1, 192.168.1.1, 192.168.11.1, …
We have adopted the strategy to use Computers in Student Labs as the bulletin boards. The same target can be achieved by using a Login Notice feature in Group policy but it’s not as attractive as graphical wallpapers with message which grabs the att…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question