Sign in to follow this  
Followers 0
dinodod

Remotely execute a script under another profile

7 posts in this topic

What I am needing to do is take inventory of user settings remotely (Desktop icons, Screen res, printers, etc) but these are things that are stored in your profile. If I remotely connect to a PC, I will either use my profile or Network Services to connect.

I am toying around with the thought of utilizing the AT command after I copy my script to the remote PC and see if that might execute my script under the user's profile instead of mine. I was wondering if anyone had any thoughts on this as well as perhaps a better solution? I have a feeling the AT command will have a slew of issues.

Thanks!

1 person likes this

Digital Chaos - Life as we know it today.I'm a Think Tank. Problem is, my tank is empty.The Quieter you are, the more you can HearWhich would you choose - Peace without Freedom or Freedom without Peace?Digital Chaos Macgyver ToolkitCompletely Dynamic MenuSQLIte controlsAD FunctionsEXCEL UDFPC / Software Inventory UDFPC / Software Inventory 2GaFrost's Admin Toolkit - My main competitor :)Virtual SystemsVMWAREMicrosoft Virtual PC 2007

Share this post


Link to post
Share on other sites



I'm pretty sure this can be done all through the registry.

For example (Resolution)

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Hardware Profiles

Contains the numer of different hardware profiles on the computer.

And printers is in there too.

Share this post


Link to post
Share on other sites

I'm pretty sure this can be done all through the registry.

For example (Resolution)

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Hardware Profiles

Contains the numer of different hardware profiles on the computer.

And printers is in there too.

Those settings are PER MACHINE. I need to pulll PER USER settings (the user who is actually logged on). Printers and other settings can be mapped differently under each profile which is why I need PER USER and not PER MACHINE.

The AT command didn't work as I guessed:

---------------------------------------------------------------------------------------------------------------------------------------

at \\fhzdmis005 21:35 /interactive "c:\temp\usersettingsinfo.exe" <-- Ran under Network Service

This looks promising but I am getting access denied even when I use the admin account on both the /U and the /RU fields (as well as the passwords). Lots of articles on the access denied but no resolution yet.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

schtasks /create /s *** /tn UserInfo /u *** /p *** /RU *** /rp *** /tr c:\temp\usersettingsinfo.exe /st 21:50 /sc once


Digital Chaos - Life as we know it today.I'm a Think Tank. Problem is, my tank is empty.The Quieter you are, the more you can HearWhich would you choose - Peace without Freedom or Freedom without Peace?Digital Chaos Macgyver ToolkitCompletely Dynamic MenuSQLIte controlsAD FunctionsEXCEL UDFPC / Software Inventory UDFPC / Software Inventory 2GaFrost's Admin Toolkit - My main competitor :)Virtual SystemsVMWAREMicrosoft Virtual PC 2007

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

getting the current user of a remote computer is something that I've tried to do aswell... under HKEY_USERS active users are stored, ie the registry settings for all users. the trick is to find out which ones are the current. (there are 2 hives loaded for each user)

HKLM\SYSTEM\CurrentContorlSet\Control\Hivelist the list of all hives currently loaded. If you know the username you could find out which hive is Currentuser under HKU. There must be a better and a faster way to find out which user is the current one, but I have yet to find it.

Desktop Icons are located under %userprofile%\desktop, and can be copied remotely.

You could also use a program that will make an inventory of the computer and store it in a database. OCS Inventory is something to look at. just use it in the loginscript, or copy it to the remote machine's all user profile startup-dir.

Edited by jinxter

> there are 10 types of people in the world, those who understand binary and those who don't.

Share this post


Link to post
Share on other sites

I found a snippet that shows me who is currently logged in which helps but then to actually copy my script and have it run in real time (anytime I need, not at startup) under that user's ID is where the challenge lies.

While I can manipulate most of the settings and inventory the files under my ID, I stil need to perform real time inventory of a user's settings (i.e. backing up a user's settings to a new PC) I work in a hospital where he PCs aren't rebooted normally except when a patch comes out that demands a reboot so you can imagine how long my inventory woud take.

Hence lies the challenge to be able to launch a program under the logged in user's ID. I have to winder how inventory software does it, like MS SMS.


Digital Chaos - Life as we know it today.I'm a Think Tank. Problem is, my tank is empty.The Quieter you are, the more you can HearWhich would you choose - Peace without Freedom or Freedom without Peace?Digital Chaos Macgyver ToolkitCompletely Dynamic MenuSQLIte controlsAD FunctionsEXCEL UDFPC / Software Inventory UDFPC / Software Inventory 2GaFrost's Admin Toolkit - My main competitor :)Virtual SystemsVMWAREMicrosoft Virtual PC 2007

Share this post


Link to post
Share on other sites

^^ Totally forgot that you needed per profile instead of per user. Hahah.. :whistle:

But it sounds like the systems could use a central networking server. One global login that works on all computers.

Share this post


Link to post
Share on other sites

^^ Totally forgot that you needed per profile instead of per user. Hahah.. :P

But it sounds like the systems could use a central networking server. One global login that works on all computers.

Again, a login script is not in real time or on-demand inventory. But that might be my only option. :whistle:


Digital Chaos - Life as we know it today.I'm a Think Tank. Problem is, my tank is empty.The Quieter you are, the more you can HearWhich would you choose - Peace without Freedom or Freedom without Peace?Digital Chaos Macgyver ToolkitCompletely Dynamic MenuSQLIte controlsAD FunctionsEXCEL UDFPC / Software Inventory UDFPC / Software Inventory 2GaFrost's Admin Toolkit - My main competitor :)Virtual SystemsVMWAREMicrosoft Virtual PC 2007

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0