• Facebook
  • Twitter
  • Youtube
  • LinkedIn
  • RSS
  • Docs
  • Comparisons
  • Blogs
  • Try NCache
  • Contact Us
Try NCache
Show / Hide Table of Contents

Add-NCacheUserOrGroup

This PowerShell cmdlet is used to add a user or group or gMSA cache user (not for admin users) to the NCache security configuration. This configuration can be applied at the NCache server (node) level or to a specific cache. The cmdlet supports role-based access control by allowing users or groups to be assigned either Admin access for full cluster management or Cache-level permissions for cache-specific operations. The cmdlet requires parameters such as the server, access level, user or group name, full Distinguished Name (DN), and administrative credentials. It validates the provided identity information, applies the necessary security metadata, and adds the user or group to the configuration. Optionally, security can be enabled automatically after successful execution, making this cmdlet essential for secure production deployments.

Important

Please note that you need to enable node security beforehand to execute this command successfully.

Add-NCacheUserOrGroup -Server -AccessLevel `
                      [-CacheName] -UserOrGroupName `
                      -UserOrGroupDN -NodeAdminCredentials `
                      [-TlsCertPath] [-TlsCertPassword] 

Examples

  • This command adds the user David Watson as an NCache admin on the server with the IP address 20.200.20.11.
$nodeAdmin = Get-Credential 

Add-NCacheUserOrGroup -Server 20.200.20.11 -AccessLevel Admin `
                      -NodeAdminCredentials $nodeAdmin -UserOrGroupName david_watson `
                      -UserOrGroupDN "CN=David Watson,OU=engineers,DC=example,DC=com" `
  • This command adds the user David Watson as a cache user for the 'defaultCache' cache hosted on the server with the IP address 20.200.20.11.
$nodeAdmin = Get-Credential 

Add-NCacheUserOrGroup -Server 20.200.20.11 -AccessLevel Cache `
                      -CacheName defaultCache -NodeAdminCredentials $nodeAdmin `
                      -UserOrGroupName david_watson `
                      -UserOrGroupDN "CN=David Watson,OU=engineers,DC=example,DC=com" `
  • The Add-NCacheUserOrGroup cmdlet also supports gMSA accounts (if the provided user name is a gMSA) where NCache queries LDAP to detect the account type and records it accordingly. The following command adds the gMSA cache user 'user1gmsa$' on the specified NCache server.
$nodeAdmin = Get-Credential 

Add-NCacheUserOrGroup -Server 20.200.20.11 -AccessLevel Cache `
                      -CacheName defaultCache -NodeAdminCredentials $nodeAdmin `
                      -UserOrGroupName user1gmsa$ `
                      -UserOrGroupDN "CN=user1gmsa,CN=Managed Service Accounts,DC=example,DC=com" `
  • This command adds a group named 'Dev' as an NCache admin group on the server with IP address 20.200.20.11.
$nodeAdmin = Get-Credential 

Add-NCacheUserOrGroup -Server 20.200.20.11 -AccessLevel Admin `
                      -NodeAdminCredentials $nodeAdmin -UserOrGroupName Dev `
                      -UserOrGroupDN "CN=Dev,OU=engineers,DC=example,DC=com" `
  • This command adds david_watson with Admin access on the specified server, using the provided node administrator credentials. It runs from a machine where NCache is not installed and connects to the server using mutual TLS (mTLS). The client certificate C:\certs\client.pem authenticates the machine running the cmdlet, and -TlsCertPassword decrypts the certificate’s password-protected private key. Omit this parameter if the private key is not encrypted.
$nodeAdmin = Get-Credential

Add-NCacheUserOrGroup -Server 20.200.20.11 -AccessLevel Admin `
                      -NodeAdminCredentials $nodeAdmin -UserOrGroupName david_watson `
                      -UserOrGroupDN "CN=David Watson,OU=engineers,DC=example,DC=com" `
                      -TlsCertPath "C:\certs\client.pem" -TlsCertPassword "clientKeyPassword"

Properties

Note

The parameters with asterisk (*) on their names are the required parameters and the rest are optional.

Parameter Data Type Description Default Value
-Server* <string> Specifies the IP address of the NCache server to which the user or group is being added. -
-UserOrGroupName* <string> Specifies the name of the user or group being added. -
-UserOrGroupDN* <string> Specifies the Distinguished Name (DN) of the user or group being added. This DN uniquely identifies the user or group in the LDAP directory. -
-AccessLevel* <string> Specifies the access level of the user or group being added. Valid values are Admin for an NCache administrator and Cache for a cache-specific user. -
-CacheName <string> Specifies the name of the cache for which the user or group is being added. This parameter is required when -AccessLevel is set to Cache. -
-NodeAdminCredentials* <pscredential> Specifies the credentials of a user with sufficient privileges to add a user or group to NCache. -
-TlsCertPath <string> Path to the client PEM certificate used to authenticate the machine running the NCache PowerShell cmdlet when connecting to an NCache server with mutual TLS (mTLS) enabled. The PEM file must contain the private key, leaf certificate, and any intermediate certificates. You can generate a certificate using New-NCacheTlsCertificate. This parameter is required when running the PowerShell module from a machine where NCache is not installed and the server requires mTLS. On a machine with an NCache server installation, the node's own certificate is used automatically. Relative paths are resolved against the current PowerShell location, and the file must exist. To configure the certificate presented by the server, use -CustomCertificatePath. -
-TlsCertPassword <string> Password used to load the encrypted private key in the PEM file specified by -TlsCertPath. Required only when the private key is password-protected. Not needed for an unencrypted private key. The password is used only to load the client certificate for the current command's connections. It is not saved in the NCache server configuration. -

Contact Us

PHONE

+1 214-619-2601   (US)

+44 20 7993 8327   (UK)

 
EMAIL

sales@alachisoft.com

support@alachisoft.com

NCache
  • Edition Comparison
  • NCache Architecture
  • Benchmarks
Try NCache
Pricing
NCache Playground

Deployments
  • Cloud
  • Docker
  • Kubernetes
  • On-Premises
Technical Use Cases
  • ASP.NET Sessions
  • ASP.NET Core Sessions
  • Pub/Sub Messaging
  • SignalR Backplane
  • Internet of Things (IoT)
  • NoSQL Database
  • Stream Processing
  • Microservices
Resources
  • Blogs
  • Foundations
  • Videos
  • Comparisons
  • Shows
  • Whitepapers
  • Articles
  • Tech Talks
  • Magazine Articles
  • Third-Party Articles
Customer Case Studies
  • Testimonials
  • Customers
Support
  • Docs
  • Schedule a Demo
  • Tips
Company
  • Leadership
  • Partners
  • News
  • Events
  • Careers
Contact Us

  • EnglishChinese (Simplified)FrenchGermanItalianJapaneseKoreanPortugueseSpanish

  • Terms of Use
  •  
  • Privacy Policy
  •  
  • Cookie Policy
© Copyright Alachisoft 2002 - . All rights reserved. NCache is a registered trademark of Diyatech Corp.
  • Facebook
  • Twitter
  • Youtube
  • LinkedIn
  • RSS