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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.