Desktop productivity for business analysts and programmers

Unable to retrieve Username of Metadata Profile using vbscript

Reply
Occasional Contributor
Posts: 5

Unable to retrieve Username of Metadata Profile using vbscript

[ Edited ]

I'm trying to capture the Username of Connections Profile via vbscript. Below is the code and the link where I referenced from :

http://support.sas.com/resources/papers/proceedings12/298-2012.pdf

 

 

' force declaration of variables in VB Script
Option Explicit
Dim Application
' Create a new SAS Enterprise Guide automation session
Set Application = WScript.CreateObject("SASEGObjectModel.Application.7.1")
WScript.Echo Application.Name & ", Version: " & Application.Version

' Discover the available profiles that are defined for the current user
Dim i
Dim oShell
Set oShell = CreateObject( "WScript.Shell" )
WScript.Echo "Metadata profiles available for " _
& oShell.ExpandEnvironmentStrings("%UserName%")
WScript.Echo "----------------------------------------"
For i = 0 to Application.Profiles.Count-1
WScript.Echo "Profile available: " _
& Application.Profiles.Item(i).Name _
& ", Host: " & Application.Profiles.Item(i).HostName _
& ", Port: " & Application.Profiles.Item(i).Port
Next
Application.Quit

 

 

Is there a way to retrieve USER of the Profile as well? I've already tried something like Application.Profiles.Item(i).User or Application.Profiles.Item(i).Username, but didn't get the desired result.

 

Please suggest.

 

Thank You.

Ask a Question
Discussion stats
  • 0 replies
  • 255 views
  • 0 likes
  • 1 in conversation