A PowerShell module for working with custom security attributes at scale. The module enables easy interaction with custom security attributes, as well as a simplified way of synchronizing HR data to Entra ID custom security attributes, by providing a lookup feature.
Metadata | Information |
---|---|
Version | 1.0.4 |
Required modules | Microsoft.Graph.Authentication |
Author | Marius Solbakken Mellum |
Company name | Goodworkaround |
PowerShell version | 7.1 |
Builds a cache of users for fastest speeds when writing custom security attributes.
Build-CustomSecurityAttributeCache [-Attribute <String>] [-Filter <String>] [-ClearCache]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
Build-CustomSecurityAttributeCache -CustomAttribute <String> [-Filter <String>] [-ClearCache]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
Builds a cache of users for fastest speeds when writing custom security attributes.
Build-CustomSecurityAttributeCache -Attribute userPrincipalName
Builds a cache of users using the userPrincipalName attribute as key.
Build-CustomSecurityAttributeCache -CustomAttribute extension_12345678_myCustomAttribute
Builds a cache of users using the applicaton extension property extension_12345678_myCustomAttribute as key.
Type: String
Parameter Sets: Well known attribute
Aliases:
Required: False
Position: Named
Default value: UserPrincipalName
Accept pipeline input: False
Accept wildcard characters: False
Type: String
Parameter Sets: Custom attribute
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Connects to the Microsoft Graph API with the required permissions for custom security attributes. Currently only interactive sign-in, but feel free to Connect-MgGraph with application credentials manually.
Connect-CustomSecurityAttribute [-TenantId <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Connect-CustomSecurityAttribute -TenantId "contoso.onmicrosoft.com"
Connects to the Microsoft Graph API with the required permissions for custom security attributes for the tenant contoso.onmicrosoft.com.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Get the custom security attribute values for a specified user.
Get-CustomSecurityAttributeValues -Key <String> [-AttributeSet <String>] [-ProgressAction <ActionPreference>]
[<CommonParameters>]
Get-CustomSecurityAttributeValues -ObjectId <String> [-AttributeSet <String>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
Get-CustomSecurityAttributeValues -UserPrincipalName <String> [-AttributeSet <String>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
Get the custom security attribute values for a specified user.
Get-CustomSecurityAttributeValues -Key "321"
Get-CustomSecurityAttributeValues -ObjectId "12345678-1234-1234-1234-123456789012"
Get-CustomSecurityAttributeValues -UserPrincipalName "[email protected]" -AttributeSet School
Get the values for the specified key from the lookup cache
Type: String
Parameter Sets: Cache
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Get the values for the specified user by ObjectId
Type: String
Parameter Sets: ObjectId
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Get the values for the specified user by userPrincipalName
Type: String
Parameter Sets: UserPrincipalName
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
If set, only return the values for the specified attribute set
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Updates the custom security attribute values for a user.
Set-CustomSecurityAttributeValues -Key <String> -AttributeSet <String> -Values <Hashtable>
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
Set-CustomSecurityAttributeValues -ObjectId <String> -AttributeSet <String> -Values <Hashtable>
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
Set-CustomSecurityAttributeValues -UserPrincipalName <String> -AttributeSet <String> -Values <Hashtable>
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
Updates the custom security attribute values for a user. The user can be specified by key (for the cache), ObjectId, or UserPrincipalName.
Set-CustomSecurityAttributeValues -Key "321" -AttributeSet School -Values @{Grade = "A"; Teacher = "Mr. Smith"}
Updates the custom security attribute values for the user with key "321" in the cache with the new values.
Set-CustomSecurityAttributeValues -ObjectId "12345678-1234-1234-1234-123456789012" -AttributeSet School -Values @{Grade = "A"; Teachers = @("Mr. Smith"; "Ms. Johnson"}
Updates the custom security attribute values for the user with ObjectId "12345678-1234-1234-1234-123456789012" with the new values.
Type: String
Parameter Sets: Cache
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: String
Parameter Sets: ObjectId
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: String
Parameter Sets: UserPrincipalName
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: Hashtable
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Prompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.