Click here to Skip to main content
15,894,646 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is my second big question of the night,

Is there a way to retrieve the current users computer name that they are currently logged into from active directory or the LDAP in a VB Windows Form method? What would I need to do so? I have access also to the SCCM Server on the IIS site so if i could pass the EDIPI from the VB form to it and have the response show in the form that would be great also.

Sincerely,

ChrisV85
Posted
Comments
[no name] 8-Jan-15 17:55pm    
Thanks everyone for your input and you are all right the easiest way is a logon script and the a tool to query the text file with the username and computer name items in it. Thanks for your help and putting up with these questions.

1 solution

You can't do what you want because AD doesn't track the machine the user is physically logged into.

Where I work, we use a VBScript that is executed on every workstation, by SCCM and reporting back to SCCM Inventory, who is logged into that machine at the time. Over time, the SCCM database builds up a picture of who "owns" the machines based on who's logged into it the most.
 
Share this answer
 
Comments
[no name] 7-Jan-15 8:24am    
We have a similar solution where I am currently working however I don't believe the login script makes action on the SCCM Inventory every time a user logs in. Is there a way to built in the SCCM queries into a VB Application form while referencing the SCCM side of IIS- Where we can query and build reports. ?
Dave Kreskowiak 7-Jan-15 8:34am    
If you have an actual login script, you don't need SCCM at all. The login script can get the machine name and currently logged in user quite easily and push that data to a database itself.

We use SCCM because we have a ton of remote users who are not connected to the enterprise network when the login to the machine and may not connect for quite a long time. The SCCM client on the machine takes care of running the job even without network connectivity.
[no name] 7-Jan-15 14:53pm    
Is there a way to make the below into a vb form? This is how we are currently accessing the sccm through our intranet here. An instead of showing the netbios name of it on another application like IE to only show it in a read only textbox in the VB form?

Computer Name Search
</title>
<script TYPE="text/javascript">

window.onload = function() {
document.getElementById("un_id").focus();
};

function setURL(){
var username = document.getElementById("un_id").value;
var sjdurl = "http://servername/SMSReporting_MHM/Report.asp?ReportID=12&variable="+username;

popup = window.open(sjdurl,"popup");

}

</script>
</head>
<body>
<br>
<div>
<label for="un_id"></label>
Enter: %25EDIPI%25<br>
<input type="Text" id="un_id" maxlength="45" size="45"/><br>
<input type='submit' >
</div>
</body>
</html>
Dave Kreskowiak 7-Jan-15 16:53pm    
You could but since you're navigating to a web report, you'd have to include the WebBrowser control in the ToolBox in your form.

The rest of your question doesn't make sense. Yes, you can get the machine name the app is running on from the Environment class in VB.NET and display it in a label. I say this as I really don't know what you're trying to ask here.
[no name] 8-Jan-15 0:21am    
I found an application that does please see my other posted questions. Maybe you could help.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900