Kaseya Community

View current user's Mapped Drives?

This question is answered

Does anyone know a way to view the mapped drives for the user that is currently logged in without doing a remote control session.

Verified Answer
  • Create a procedure to Execute Shell Command as the logged on user of "net use >> #vAgentConfiguration.agentTempDir#\mappeddrives.txt"

    After this, you can do whatever you want with the file and its contents, personally I take it and write it to the Agent Procedure Log.

All Replies
  • Create a procedure to Execute Shell Command as the logged on user of "net use >> #vAgentConfiguration.agentTempDir#\mappeddrives.txt"

    After this, you can do whatever you want with the file and its contents, personally I take it and write it to the Agent Procedure Log.

  • Agreed, but I use the a slightly different method and IMO slightly better though you make your own mind up...

    NET USE >>> "xxx.TXT"

    GET VARIABLE:

      FILE CONTENT : "xxx.TXT"

      VARIABLLE NAME: "MappedDrives"

    GET VARIABLE:

      MACHINEGROUPID:

      VARIABLE NAME: "ID"

    SEND EMAIL

      TO: #adminDefaults.adminEmail#     - This send it to the engineer who ran the script.

      SUBJECT: Mapped Drives

      CONTENT:

      "Mapped network drives for #ID#.

      #MappedDrives#"

    This way you can run it on a load of machine and just wait for the mails to pour in, I do it this way as when setting up a new client on a new domain it enables me to get all the information in my email, archive it and refer back to it all from 1 easy location (Outlook) marking as read when I have entered that users individual mappings (if any) into a new login script.

    Personally I try to send a lot of stuff to "#adminDefaults.adminEmail#" as I find this easier and probably the most useful constant variable in existence in Kaseya.

    P.S. You can also use the built in Variables for MachineName with or without the GroupName but I am stuck in my own ways...

    Machine Name       (%COMPUTERNAME%)

    • #vAgentConfiguration.machName#

    • #vMachine.machName#

    There is a topic on here with a whole list of built in Variables somewhere which is useful but I can't find it now (not looked to hard) but I have them in my emails, if you want them all see below...

    ==================================================================

    Agent Temp Dir/ Working Folder    (eg: c:\kworking)  

    • #vAgentConfiguration.AgentTempDir#

    Agent GUID  

    • #vAgentConfiguration.agentGuid#

    Contact Information configured against the Agent (In Kaseya portal: Agent > Configure Agents > Edit Profile)

    • #vAgentConfiguration.contactName#

    • #vAgentConfiguration.contactEmail#

    Network Information      

    • #vMachine.IpAddress#

    • #vMachine.SubnetMask#

    • #vMachine.DefaultGateway#

    • #vMachine.DnsServer1#

    • #vMachine.DnsServer2#

    • #vMachine.DnsServer3#

    • #vMachine.DnsServer4#

    • #vMachine.DhcpEnabled#

    • #vMachine.DhcpServer#

    • #vMachine.ConnectionGatewayIp#

    • #vMachine.MacAddr#

    • #vMachine.timezoneOffset#

    Machine Name       (%COMPUTERNAME%)

    • #vAgentConfiguration.machName#

    • #vMachine.machName#

    Machine+Group     (computername.sub-machinegroup.machinegroup)

    • #vAgentConfiguration.Machine_GroupID#

    Machine Group name (sub-machinegroup.machinegroup)

    • #vAgentConfiguration.groupName#

    Current Logged in User Account Name  

    • #vAgentConfiguration.currentUser#

    Last Logged in User Account Name

    • #vAgentConfiguration.lastLoginName#

    OS Version

    • #vMachine.OsInfo#

    • #vMachine.MajorVersion#     (5 = XP/2003, 6 = Vista/7/2008)

    Domain Name (Domain or Workgroup name)

    • #vAgentConfiguration.workgroupDomainName#

    Domain Type

    • #vAgentConfiguration.workgroupDomainType#

    0 (or Null) = unknown

    1 = not joined to either

    2 = member of workgroup

    3 = member of domain

    4 = domain controller

    Patch managment

    • #vPatchConfiguration.FileSourceUNCPath#   - Patch File Source UNC Path

    • #vPatchConfiguration.FileSourceLocalPath#   - Patch File Source Local Path

    • #vPatchConfiguration.FileSourceMachineId#   - Patch File Source Machine Id

    • #vPatchConfiguration.RebootAction#      - Patch Reboot Action

    • #vPatchConfiguration.contactName#

    • #vPatchConfiguration.contactEmail#

    ==================================================================

    Please note these weren't all found by me and certainly have not all been tested so any problems please post a new topic rather then looking to me, though I will still 'try' to help if I can.

    Thanks

    Stuart Hamilton.

  • That list of Database Views looks oddly familiar Smile

  • I second Stu's idea of sending emails One thing I have found useful is to use rules in Outlook so I can have a procedure go and collect some info for a particular project, then when I come back to that project all the data is there.

    Another thing I like about it is if I go and run an agent on a procedure I can then go and get myself engrossed in another task and later on the email serves as a reminder of the first task I was doing.

  • Stu's idea is OK, but if you're working with a company that has several hundred endpoints all receiving/sifting through all of those emails might drive one mad.... I prefer to write my results the the procedure log, then run a report from that.