<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How make COM work in a SSH terminal? in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/How-make-COM-work-in-a-SSH-terminal/m-p/907710#M27697</link>
    <description>&lt;P&gt;I run the same simple powershell code as below in remote ssh and remote desktop and there are some difference in $objServerDef.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$objFactory = New-Object -ComObject SASObjectManager.ObjectFactoryMulti2
$objServerDef = New-Object -ComObject SASObjectManager.ServerDef
$objServerDef&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SSH: (not stable, sometimes it include `ServiceName:sasobjspawn`, `port : 0`, but other times may not)&lt;/P&gt;&lt;PRE&gt;Protocol                   : 0
Description                :
DomainName                 :
LogicalName                :
BridgeEncryptionLevel      : 0
BridgeEncryptionAlgorithm  :
RecycleActivationLimit     : 0
RunForever                 : True
ShutdownAfter              : 3
ClassIdentifier            : 440196D4-90F0-11D0-9F41-00A024BB830C
ProgID                     : SAS.Workspace.1.0
ID                         :
URI                        : iom://localhost;COM;CLSID=440196D4-90F0-11D0-9F41-00A024BB830C,ENCRLVL=None/
ExtraNameValuePairs        :
BridgeSecurityPackage      :
BridgeServicePrincipalName :
BridgeSecurityPackageList  : Kerberos,NTLM
AuthenticationService      :&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Remote Desk:&lt;/P&gt;&lt;PRE&gt;Port                       : 0   
ServiceName                : sasobjspawn
Name                       :
MachineDNSName             :
Protocol                   : 0
Description                :
DomainName                 :
LogicalName                :    
BridgeEncryptionLevel      : 0
BridgeEncryptionAlgorithm  :
DCOMSecurityService        : 0
DCOMAuthenticationLevel    : 0
MaxPerObjectPool           : 10
RecycleActivationLimit     : 0
RunForever                 : True
ShutdownAfter              : 3
ClassIdentifier            : 440196D4-90F0-11D0-9F41-00A024BB830C
ProgID                     : SAS.Workspace.1.0
ID                         :
URI                        : iom://localhost;COM;CLSID=440196D4-90F0-11D0-9F41-00A024BB830C,ENCRLVL=None/
ExtraNameValuePairs        :
BridgeSecurityPackage      :
BridgeServicePrincipalName :
BridgeSecurityPackageList  : Kerberos,NTLM
AuthenticationService      :
ProxyList                  : {}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Dec 2023 07:59:53 GMT</pubDate>
    <dc:creator>ShuguangSun</dc:creator>
    <dc:date>2023-12-13T07:59:53Z</dc:date>
    <item>
      <title>How make COM work in a SSH terminal?</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-make-COM-work-in-a-SSH-terminal/m-p/907332#M27678</link>
      <description>&lt;P&gt;I tried to using powershell to call SAS via COM. However it doesn't work in some situation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a SAS installed on a remote windows machine with no SAS Integration Technologies (e.g. no IOM access or sas EG access or metadata server or no workspace server). When I login in via windows remote desktop, I can run sas code via COM in vscode. But if I sign in by SSH, I have the same error report as you reported.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below I tried step by step powershell script in the ssh terminal, an error throwed in `$objSAS.LanguageService.Submit`&lt;/P&gt;&lt;PRE&gt;$objFactory = New-Object -ComObject SASObjectManager.ObjectFactoryMulti2
$objServerDef = New-Object -ComObject SASObjectManager.ServerDef
$objServerDef
$objServerDef.MachineDNSName = "xxx.xx.x.x" # SAS Workspace node
$objServerDef.Port = 0 # workspace server port
$objServerDef.Protocol = 0 # 0 = COM protocol
$objServerDef

# Class Identifier for SAS Workspace
$objServerDef.ClassIdentifier = "440196d4-90f0-11d0-9f41-00a024bb830c"

# create and connect to the SAS session
$objSAS = $objFactory.CreateObjectByServer(
"Local", # server name
$true,
$objServerDef, # built server definition
"", # user ID
"" # password
)

$program = "proc sql; create table work.test as select* from perm.data; proc print data=work.test;run;"

$objSAS.LanguageService.Submit($program);

$objSAS.Close()&lt;/PRE&gt;&lt;P&gt;An error raised after `$objSAS.LanguageService.Submit($program)`&lt;/P&gt;&lt;PRE&gt;You cannot call a method on a null-valued expression.
+ $objSAS.LanguageService.Submit($program);
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) []，RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;**Environment:**&lt;BR /&gt;Client OS: Windows 2019&lt;BR /&gt;SAS version: SAS 9.4 with ITC only, but not IT (e.g. IOM not enabled)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2023 14:10:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-make-COM-work-in-a-SSH-terminal/m-p/907332#M27678</guid>
      <dc:creator>ShuguangSun</dc:creator>
      <dc:date>2023-12-11T14:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: How make COM work in a SSH terminal?</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-make-COM-work-in-a-SSH-terminal/m-p/907361#M27681</link>
      <description>After you run the $objSAS definition, if you echo it does it have a listing for LanguageService? Do you see a SAS program running in the background? &lt;BR /&gt;&lt;BR /&gt;PS C:\Users\grwoot&amp;gt; $objSAS = $objFactory.CreateObjectByServer("Local",$true,$objServerDef,"","")&lt;BR /&gt;PS C:\Users\grwoot&amp;gt; $objSAS&lt;BR /&gt;&lt;BR /&gt;LanguageService  : System.__ComObject&lt;BR /&gt;DataService      : System.__ComObject&lt;BR /&gt;FileService      : System.__ComObject&lt;BR /&gt;ODS              : System.__ComObject&lt;BR /&gt;Utilities        : System.__ComObject&lt;BR /&gt;Name             : SAS Workspace&lt;BR /&gt;UniqueIdentifier : 26C88ED3-72A2-4E78-933C-CB445314AB2B&lt;BR /&gt;&lt;BR /&gt;PS C:\Users\grwoot&amp;gt; ps |findstr "sas"&lt;BR /&gt;   2397      38    15792      36568              1020   0 lsass&lt;BR /&gt;    414      40    30600      35264       0.22  25648   1 sas&lt;BR /&gt;PS C:\Users\grwoot&amp;gt; $objSAS.Close()&lt;BR /&gt;PS C:\Users\grwoot&amp;gt; ps |findstr "sas"&lt;BR /&gt;   2399      38    15888      36664              1020   0 lsass&lt;BR /&gt;PS C:\Users\grwoot&amp;gt;</description>
      <pubDate>Mon, 11 Dec 2023 17:22:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-make-COM-work-in-a-SSH-terminal/m-p/907361#M27681</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2023-12-11T17:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: How make COM work in a SSH terminal?</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-make-COM-work-in-a-SSH-terminal/m-p/907450#M27685</link>
      <description>&lt;P&gt;No SAS instance. The service is empty.&lt;/P&gt;&lt;PRE&gt;LanguageService  :
DataService      :
FileService      :
ODS              :
Utilities        :
Name             : SAS Workspace
UniqueIdentifier : 866FB099-92A3-4445-9C7F-5C137534D265&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Remote powershell policy&lt;/P&gt;&lt;PRE&gt;# Get-ExecutionPolicy -list

        Scope ExecutionPolicy
        ----- ---------------
MachinePolicy       Undefined
   UserPolicy       Undefined
      Process       Undefined
  CurrentUser    RemoteSigned
 LocalMachine    RemoteSigned&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Dec 2023 00:32:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-make-COM-work-in-a-SSH-terminal/m-p/907450#M27685</guid>
      <dc:creator>ShuguangSun</dc:creator>
      <dc:date>2023-12-12T00:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: How make COM work in a SSH terminal?</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-make-COM-work-in-a-SSH-terminal/m-p/907546#M27689</link>
      <description>Seems like something is blocking your ability to start a process when signed in remotely. Do you have "Log on as a Batch Job" privilege on the remote host? Do you see any errors in the Event Viewer?&lt;BR /&gt;&lt;BR /&gt;Windows Privileges&lt;BR /&gt;&lt;A href="https://go.documentation.sas.com/doc/en/bicdc/9.4/bisecag/p1uhz7klzwwvr8n1r51h0nhcw2zm.htm" target="_blank"&gt;https://go.documentation.sas.com/doc/en/bicdc/9.4/bisecag/p1uhz7klzwwvr8n1r51h0nhcw2zm.htm&lt;/A&gt;</description>
      <pubDate>Tue, 12 Dec 2023 14:11:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-make-COM-work-in-a-SSH-terminal/m-p/907546#M27689</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2023-12-12T14:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: How make COM work in a SSH terminal?</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-make-COM-work-in-a-SSH-terminal/m-p/907607#M27693</link>
      <description>&lt;P&gt;We have a 'sasusers' group on the windows 2019 server, and I'm in the group.&lt;/P&gt;&lt;P&gt;I can schedul task via SSH, like:&lt;/P&gt;&lt;PRE&gt;schtasks /create /tn %USERNAME%_test_sas /tr C:\Users\%USERNAME%\run_getopts.bat /sc once /sd 2023/12/13 /st 00:46 /ru %USERNAME% /rp&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We use SAS OA last week and now switch to SAS foundation. The powershell code worked before, but doesn't work after we switched to SAS foundation. We should have ITC (no metadata sever) as the code works with COM when I login via Remote Desktop.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 16:47:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-make-COM-work-in-a-SSH-terminal/m-p/907607#M27693</guid>
      <dc:creator>ShuguangSun</dc:creator>
      <dc:date>2023-12-12T16:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: How make COM work in a SSH terminal?</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-make-COM-work-in-a-SSH-terminal/m-p/907627#M27694</link>
      <description>If this process stopped working when you moved to not having Integration Technologies I would suspect that as the cause, its odd that we aren't getting an error from the CreateObjectByServer call. Did you see anything in the Windows Event Viewer?</description>
      <pubDate>Tue, 12 Dec 2023 19:07:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-make-COM-work-in-a-SSH-terminal/m-p/907627#M27694</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2023-12-12T19:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: How make COM work in a SSH terminal?</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-make-COM-work-in-a-SSH-terminal/m-p/907698#M27695</link>
      <description>&lt;P&gt;I can't find anything related in the Windows Event Viewer.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 03:48:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-make-COM-work-in-a-SSH-terminal/m-p/907698#M27695</guid>
      <dc:creator>ShuguangSun</dc:creator>
      <dc:date>2023-12-13T03:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: How make COM work in a SSH terminal?</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-make-COM-work-in-a-SSH-terminal/m-p/907710#M27697</link>
      <description>&lt;P&gt;I run the same simple powershell code as below in remote ssh and remote desktop and there are some difference in $objServerDef.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$objFactory = New-Object -ComObject SASObjectManager.ObjectFactoryMulti2
$objServerDef = New-Object -ComObject SASObjectManager.ServerDef
$objServerDef&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SSH: (not stable, sometimes it include `ServiceName:sasobjspawn`, `port : 0`, but other times may not)&lt;/P&gt;&lt;PRE&gt;Protocol                   : 0
Description                :
DomainName                 :
LogicalName                :
BridgeEncryptionLevel      : 0
BridgeEncryptionAlgorithm  :
RecycleActivationLimit     : 0
RunForever                 : True
ShutdownAfter              : 3
ClassIdentifier            : 440196D4-90F0-11D0-9F41-00A024BB830C
ProgID                     : SAS.Workspace.1.0
ID                         :
URI                        : iom://localhost;COM;CLSID=440196D4-90F0-11D0-9F41-00A024BB830C,ENCRLVL=None/
ExtraNameValuePairs        :
BridgeSecurityPackage      :
BridgeServicePrincipalName :
BridgeSecurityPackageList  : Kerberos,NTLM
AuthenticationService      :&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Remote Desk:&lt;/P&gt;&lt;PRE&gt;Port                       : 0   
ServiceName                : sasobjspawn
Name                       :
MachineDNSName             :
Protocol                   : 0
Description                :
DomainName                 :
LogicalName                :    
BridgeEncryptionLevel      : 0
BridgeEncryptionAlgorithm  :
DCOMSecurityService        : 0
DCOMAuthenticationLevel    : 0
MaxPerObjectPool           : 10
RecycleActivationLimit     : 0
RunForever                 : True
ShutdownAfter              : 3
ClassIdentifier            : 440196D4-90F0-11D0-9F41-00A024BB830C
ProgID                     : SAS.Workspace.1.0
ID                         :
URI                        : iom://localhost;COM;CLSID=440196D4-90F0-11D0-9F41-00A024BB830C,ENCRLVL=None/
ExtraNameValuePairs        :
BridgeSecurityPackage      :
BridgeServicePrincipalName :
BridgeSecurityPackageList  : Kerberos,NTLM
AuthenticationService      :
ProxyList                  : {}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 07:59:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-make-COM-work-in-a-SSH-terminal/m-p/907710#M27697</guid>
      <dc:creator>ShuguangSun</dc:creator>
      <dc:date>2023-12-13T07:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: How make COM work in a SSH terminal?</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-make-COM-work-in-a-SSH-terminal/m-p/907763#M27701</link>
      <description>In checking with another resource here they advised that if the current thread has a SECURITY_NETWORK Security Identifier (SID), it is considered remote and Integration Technologies must be licensed, so this is probably what is happening when you connect via SSH, and why it worked previously.</description>
      <pubDate>Wed, 13 Dec 2023 14:52:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-make-COM-work-in-a-SSH-terminal/m-p/907763#M27701</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2023-12-13T14:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: How make COM work in a SSH terminal?</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-make-COM-work-in-a-SSH-terminal/m-p/907959#M27704</link>
      <description>&lt;P&gt;Thanks. Will check with SAS admin.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 00:20:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-make-COM-work-in-a-SSH-terminal/m-p/907959#M27704</guid>
      <dc:creator>ShuguangSun</dc:creator>
      <dc:date>2023-12-14T00:20:58Z</dc:date>
    </item>
  </channel>
</rss>

