I want to find the list of active users and the connection time-in and out using SAS Environment manager.
But in our environmment the Report center is currently unavailable, as the Service Architecture has not been initialized. So unable to see the reports related to APM and ACM.
Is there any other way we can get the list of active users, using the SAS Environment manager.
Thanks & Regards,
Not Environment Manager, but if you have Windows servers then the attached Powershell script produces a current list of users (you'll need to change the extension to .ps1). I schedule it to run every 15 minutes on our compute server, and I can then load the resulting CSV files into SAS and process them. It can't tell when a user disconnects but I can estimate that to some time in the 15 minutes before their process disappears. Alternatively, you may be able to parse the Object Spawner log. I've not tried that.
@Nigel_Pain Using our local sas Admin account, I tried your excellent PowerShell script as Administrator. Seeing the full cmdline including SERVERCOMPONENT/A5FRC3I9.AY000005 is great for identifying the Logical server.
Results from Get-Process -Name sas -IncludeUserName are much more limited but better than nothing.
How do you view your results? I am trying to design something suitable for SysAdmins on the desktop of Windows Data Center 2019. For SAS users, I can create a Stored Process. PowerShell GUI looks promising for RDP users.
I'm glad it's useful.
As you say, Get-Process is quite limiting. Get-WmiObject is useful for getting the owner, parent and command line, although having identified how to do this last one I don't think I actually use it. I should really think about replacing Get-WmiObject with the newer Get-CimInstance but sometimes life's too short, and it works!
I use a SAS program to join this data with parsed object spawner logs and data from our business directory database. This gives me data sets with full organisational information which I can use for monitoring purposes and also for recharging our licence costs. Nobody else uses it!
But given that the results of the Powershell are in the CSV files, other tools could be used for processing them fairly easily (not as nicely as SAS, I would contend 😉).
Have to say, I love Powershell! I was brought kicking and screaming from a Solaris environment when it was decided to move our SAS servers to Windows about 10 years ago. I'd been scratching my head trying to work out how to replace a whole load of shell scripts with Windows .bat files (not possible!) But then someone suggested I look at Powershell and the rest, as they say, is history.
I am encouraged by your endorsement of PowerShell. I have dabbled for years but it is hard to replace 20 years of shell scripts.
Regarding gathering usage metrics, I have found that management are rarely interested until there is an issue - review of licensing costs or some other product they have been convinced is cheaper. Lately, it has been cloud cost estimates.
One day before I retire, I am hoping there will be in person user group meetings to discuss this stuff.
The SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment.
Learn how to install the SAS Viya CLI and a few commands you may find useful in this video by SAS’ Darrell Barton.
Find more tutorials on the SAS Users YouTube channel.