The transition to NetApp MS Azure AD B2C is complete. If you missed the pre-registration, you will be invited to reigister at next log in.
Please note that access to your NetApp data may take up to 1 hour.
To learn more, read the FAQ and watch the video.
Need assistance? Complete this form and select “Registration Issue” as the Feedback Category.

Microsoft Virtualization Discussions

Ontap PowerShell, Unix-User and cDot

tomers

Hi guys, 

 

on cDot CLI we have this command to add and remove users

vserver services unix-user create -vserver SVM -user USER........

 

I need to create a script that do that, do we have a cmdlet for it in the toolkit ?

 

 

*on 7-mode we called those passwd file.

 

 

Thanks, 

 

Tomer.

5 REPLIES 5

HONIG2012

well i think "New-NcUser" should solve your problem for cDOT systems

grEEtz

 

-----

> man new-ncuser

NAME
    New-NcUser

SYNOPSIS
    Create a new user account associated with the specified application and authentication method.


SYNTAX
    New-NcUser [-UserName] <String> -Vserver <String[]> -Application <String[]> [-AuthMethod <String>] -Role <String> [-Password <String>] [-Comment
    <String>] [-Controller <NcController[]>] [-ZapiRetryCount <Int32>] [<CommonParameters>]

    New-NcUser -Vserver <String[]> -Application <String[]> [-AuthMethod <String>] -Role <String> [-Credential <PSCredential>] [-Comment <String>]
    [-Controller <NcController[]>] [-ZapiRetryCount <Int32>] [<CommonParameters>]


DESCRIPTION
    Create a new user account associated with the specified application and authentication method.

 

 

tomers

Hi, 

Thanks for replaying.

New-NcUser is for creating users for login (ssh\ontapi....)

 

but i just found what i needed. its NcNameMappingUnixUser

Get-NcNameMappingUnixUser

Set-NcNameMappingUnixUser

New-NcNameMappingUnixUser

Remove-NcNameMappingUnixUser

 


Thank you.

Tomer.

Livewire18

 

I am trying to backup my name mappings... 

 

When running from PS> prompt, it gives me the info in a nice table. When doing so in a script though, it comes out unusable (shown below). I have been trying to find a way to cycle through the object and grabe the needed fields like I have done with other cmdlets, but no use so far. Do you have any suggestions in how to get the named fields below to be variables?

 

 

 

FullName :
GroupId : 1
NcController : cluster.domain.name
UserId : 0
UserName : root
Vserver : vserver01
GroupIdSpecified : True
UserIdSpecified : True

tomers

It depand on what do you want to do with it and how.

For example if you want to see the username+UID+vservername on screen then use this: 

$NcNameMappingUnixUser = NcNameMappingUnixUser; foreach($line in $NcNameMappingUnixUser) {write-host "$($line.UserName) $($line.UserId) $($line.Vserver)"}

if you want to check for specific user name in a specific vserver use this: 

$NcNameMappingUnixUser = NcNameMappingUnixUser; foreach($line in $NcNameMappingUnixUser) {if ($line.UserName -eq 'pcuser' -and $line.Vserver -eq 'svm1') {write-host $($line.UserName)  $($line.UserId) $($line.Vserver)"}}

or:

$NcNameMappingUnixUser = NcNameMappingUnixUser; $NcNameMappingUnixUser | ForEach-Object {if ($_.UserId -eq 65535) {$_ | Format-Table UserName,  UserId, Vserver} }

 

or just format-table: 

$NcNameMappingUnixUser | Format-Table UserName,  UserId, Vserver

 

so it depends on what you want to gain, but those are more Powershell tips them DataOntap ToolKit.

 

Livewire18

This is perfect! Thank you very much.

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public