UserUnixProfileExists

Checks whether a UNIX profile exists for the specified user in the zone.

Syntax

bool UserUnixProfileExists(IUser user)

Parameter

Specify the following parameter when using this method:

Parameter Description

user

The user name for which you want to check whether a UNIX profile exists.

Return value

Returns true if a UNIX profile is found in the zone for the specified user, or false if no UNIX profile exists for the user in the zone.

Exceptions

UserUnixProfileExists may throw one of the following exceptions:

  • ArgumentNullException if the specified parameter value is null.
  • NotSupportedException if the zone schema is not supported.

Example

The following code sample illustrates using this method in a script:

...
'Specify the zone you want to work with
set objZone = cims.GetZone("ajax.org/UNIX/Zones/test_lab")
'Check whether there’s a UNIX profile for the user “garcia”
if objZone.GroupUnixProfileExists(garcia) = true
   wScript.Echo “Profile exists in this zone“
else
   wScript.Echo “No matching profile in this zone!“
end if
...