This message was deleted.
# _general
s
This message was deleted.
j
Wouldn't it make more sense to query the installed software rather than the shortcuts? Or is there some app tooling in use that makes that difficult?
j
You can probably look in the XML file that EM uses for its configuration to see all the shortcuts. There's also a feature in the console that lets you export the configuration.
t
We dont have everything installed that’s why we need both. Some run off shares and are copy and pasted into program files and shortcut added to user profile but tricky we have exported the xml but it’s huge so trying to play with powershell now
d
LOL its huge, tell that to Ivanti.... but if you & me would have been the only ones working on the config it would have been easy to do this. Too bad, shortcuts have also copied from other locations using native file/folder tasks, even with powershell... I will show you Monday what I mean 😢.
t
Chat Monday Dennis, I think we have managed to put something together that grabs the info we need but I agree the config is a mess because people who don’t understand the product just got allowed to make changes without any real thinking
a
Hey Ashley, long time no speak mate! Here is a script I wrote for this exact same purpose. 😉
Copy code
#Get the contents of EM config XML file
 [xml]$xml = Get-Content -path  "C:\temp\EM_Config_shortcuts_15062020\Configuration.xml"
 
 #Function to recurse through Appsense EM XML config and return shortcuts, printers, or mapped drives along with their AD group condition (if any) 
 Function Recurse_EM_XML
 {
  [cmdletbinding()]
  Param 
    (
      [Parameter(Mandatory=$true)]
      [object]$XMLFile,      
      [ValidateSet("UEM.Action.Drive.Map","UEM.Action.Shortcut","UEM.Action.Printer.Map")]
      [string[]]
      $LookedForProperty="UEM.Action.Shortcut"
    ) 
  
#check the identifier name, if matches, collect the AD group name   
    if ($XMLFile.Identifier -eq "UEM.Condition.UserGroupMembership") {
            $ou = ($XMLFile.ActionProperties.ActionProperty | where {$_.name -eq "GroupName"} ).value
    }
          
    
#check the identifier name - if matches, collect the description and the enable/disable status
    if ($XMLFile.Identifier -eq "UEM.Action.Shortcut") {
        $description = $XMLFile.description.text 
        $enabled = $XMLFile.enabled    

        #Create the final object for output
        New-Object -Type PSObject -Property @{            
            Name = $description 
            Path = ($XMLFile.ActionProperties.ActionProperty | where {$_.name -eq "TargetPath" }).value
            Parameters = ($XMLFile.ActionProperties.ActionProperty | where {$_.name -eq "Parameters" }).value
            OU = $OU
            Enabled = $Enabled
        } 
        $description = $null
        $OU = $null
    }

    if ($XMLFile.Identifier -eq "UEM.Action.Drive.Map") {
        $description = $XMLFile.description.text 
        $enabled = $XMLFile.enabled    

        #Create the final object for output
            New-Object -Type PSObject -Property @{            
                Name = $description 
                #Dive one more layer in to get more properties 
                DriveLetter = ($XMLFile.ActionProperties.ActionProperty | where {$_.name -eq "DriveLetter" }).value
                RemotePath = ($XMLFile.ActionProperties.ActionProperty | where {$_.name -eq "RemotePath" }).value 
                FriendlyName = ($XMLFile.ActionProperties.ActionProperty | where {$_.name -eq "FriendlyName" }).value 
                OU = $OU
                Enabled = $Enabled
            } 
        $description = $null
        $OU = $null
    }

    if ($XMLFile.Identifier -eq "UEM.Action.Printer.Map") {
        $description = $XMLFile.name 
        $enabled = $XMLFile.enabled    

        #Create the final object for output
             New-Object -Type PSObject -Property @{            
            Name = $description 
            Path = ($XMLFile.ActionProperties.ActionProperty | where {$_.name -eq "Path" }).value
            #Parameters = ($XMLFile.ActionProperties.ActionProperty | where {$_.name -eq "Parameters" }).value
            OU = $OU
            Enabled = $Enabled
        } 
        $description = $null
        $OU = $null
    }
   

  If ($XMLFile.HasChildNodes)
  {
   $Child_Nodes = $XMLFile.ChildNodes | Where {$_.NodeType -Eq "Element"}
   if ($Child_Nodes -ne $null) {
    ForEach ($Node In $Child_Nodes)
    {
     Recurse_EM_XML $Node
    }
   }
  }
 }

 $res = @()
 $res += Recurse_EM_XML -LookedForProperty UEM.Action.Shortcut -XMLFile $xml
 $res | Export-Csv -Path C:\temp\shortcuts_extract.csv -Force -NoTypeInformation
🙌 1
d
Whoop whoop, now Ash can stay in bed longer on Monday ;)
🤣 1
by the way @theshadow87 , 2020.3 has just been released, we were promised to finally get that Enterprise worthy Console, it's not mentioned in the Release Notes..... terrible beast must have cost us over 100k EUR on just waiting for the config to open and close by now
@Amir Joseph Sayes script didn't return any shortcuts for me, I did change "Recurse_Levels_Shortcuts" into "Recurse_EM_XML" for it to work. it does show drive mappings though
a
I just fixed the typo. Thanks for that. Odd it didn’t return shortcuts! Maybe it needs adjustment to suit your XML shortcut structure... paste a block here showing a shortcut from your XML and I can have a look if you want.
d
hmm now after dinner, I closed and opened ISE again, dropped the script in and it does work now, nice
👍 1
t
Thanks mate how you doing it has been a very long time indeed
🍺 1
I’ll have a play around tomorrow with script I’m hanging today after a 15 hour drinking binge
🤣 1
Nice script works really nice we will need to make a small few changes to suit how we are adding some of our shortcuts we are doing a copy file action in a couple of scenarios the drive mappings one is nice I like that we get asked that question from time to time aswel
👍 1
Here is how We are creating the adobe shortcut <EMSnippet ClassName="UEM.EMSnippet.0000" CreatedByVerion="10.2.533.0" OriginConfigFriendlyName="" OriginConfigID="725B2DC6-C672-4CF5-8736-1D6EBA867896"> <Branches ClassName="UEM.BranchCollection.0000"> <Branch ClassName="UEM.Branch.0000" OriginalPath="Configuration.User.Events.Logon.Branches.Item(1).Branches.Item(2).Branches.Item(1).Branches" VersionNumber="0" LinkID="C0460F7E-59EE-45F1-90BA-10A0CB336ED5" OriginalLinkId="7DD1797E-091C-481B-98E5-2ECE220F321B" OriginID="725B2DC6-C672-4CF5-8736-1D6EBA867896" Name="Adobe Acrobat DC" Enabled="True" EventType="UserLogOn"> <Actions ClassName="UEM.ActionBaseCollection.0000"> <Action ClassName="UEM.Action.0000" Identifier="UEM.Condition.UserGroupMembership" ActionType="67108864" LinkID="AF280399-0118-481E-84E4-A1E03840961A" OriginalLinkId="67622A9F-951E-430E-9450-8B81DC37E0A9" OriginID="725B2DC6-C672-4CF5-8736-1D6EBA867896" Name="User Group is Equal to LPGP CTX Apps Adobe Acrobat DC 20. LSA Supported" Enabled="True" StopOnFail="True" IsCached="On" EventType="UserLogOn"> <ActionProperties ClassName="UEM.ActionPropertyCollection.0000"> <ActionProperty ClassName="UEM.ActionProperty.0000" Name="Operator" PropertyType="String" Value="Equal" /> <ActionProperty ClassName="UEM.ActionProperty.0000" Name="GroupName" PropertyType="String" Value="CN=LPGP CTX Apps Adobe Acrobat DC 20,OU=Application Groups,OU=Citrix Groups,OU=Citrix Environment,DC=emea,DC=leaseplancorp,DC=net" /> <ActionProperty ClassName="UEM.ActionProperty.0000" Name="Query" PropertyType="String" Value="" /> <ActionProperty ClassName="UEM.ActionProperty.0000" Name="GroupSID" PropertyType="String" Value="S-1-5-21-1390067357-1450960922-725345543-361416" /> </ActionProperties> <Description ClassName="UEM.Description.0000" Text="" /> <Notes ClassName="UEM.Notes.0000" Text="" /> <Actions ClassName="UEM.ActionBaseCollection.0000"> <Action ClassName="UEM.Action.0000" Identifier="UEM.Action.File.Copy" ActionType="4" LinkID="DA39BCFE-89F7-4275-AEF3-B3F17960257A" OriginalLinkId="C4D8FF1D-864B-4C05-8937-ED06C2D27BC5" OriginID="725B2DC6-C672-4CF5-8736-1D6EBA867896" Name="Copy File > C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Adobe Acrobat DC.lnk" Enabled="True" EventType="UserLogOn"> <ActionProperties ClassName="UEM.ActionPropertyCollection.0000"> <ActionProperty ClassName="UEM.ActionProperty.0000" Name="Source" PropertyType="String" Value="C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Adobe Acrobat DC.lnk" /> <ActionProperty ClassName="UEM.ActionProperty.0000" Name="Target" PropertyType="String" Value="C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Adobe Acrobat DC\Adobe Acrobat DC.lnk" /> <ActionProperty ClassName="UEM.ActionProperty.0000" Name="FailIfExists" PropertyType="Boolean" Value="True" /> <ActionProperty ClassName="UEM.ActionProperty.0000" Name="RunAs" PropertyType="String" Value="CurrentUser" /> <ActionProperty ClassName="UEM.ActionProperty.0000" Name="Exclusions" PropertyType="Collection" /> </ActionProperties> <Description ClassName="UEM.Description.0000" Text="" /> <Notes ClassName="UEM.Notes.0000" Text="" /> </Action> </Actions> </Action> </Actions> </Branch> </Branches> <RunAsUserLibrary ClassName="UEM.RunAsUserLibrary.0000" RunAsUserLibraryID="666FA4DE-BE94-4028-8CA8-C46EE3914A9C" /> </EMSnippet>
a
Now published in a blog post https://tinyurl.com/y8lprxlz
👏 2
d
@Amir Joseph Sayes the test automation is triggered from TFS, it's now using Powershell Pester and is being converted to Ivanti Automation. Reports are being sent back to TFS
👍🏻 1