linux – AD插件或实用程序,在创建时生成唯一的uidnumbergidnumber

linux – AD插件或实用程序,在创建时生成唯一的uidnumbergidnumber,第1张

概述我正在寻找: 一个插件,它将为新用户自动生成唯一的uidNumber属性值,并在创建时为新组生成唯一的gidNumber属性值. 可配置的用户/组管理应用程序,可以生成上面的唯一值,以及填充Linux集成所需的各种其他属性 我们目前正在使用一个本土的脚本和网页来完成所有这些,但我们正在寻找一些我们不需要维护的东西,并且更加精致. 有人知道一个适合该法案的好工具吗? 谢谢! 我不知道任何实际触发创建 我正在寻找:

一个插件,它将为新用户自动生成唯一的uIDNumber属性值,并在创建时为新组生成唯一的gIDNumber属性值.

可配置的用户/组管理应用程序,可以生成上面的唯一值,以及填充Linux集成所需的各种其他属性

我们目前正在使用一个本土的脚本和网页来完成所有这些,但我们正在寻找一些我们不需要维护的东西,并且更加精致.

有人知道一个适合该法案的好工具吗?

谢谢!

解决方法 我不知道任何实际触发创建的现有工具.虽然像尼克提到的那样,但假设可以写一些可以做到这一点的东西是可能的.

但实际上,用户/组在已经自动化的流程之外创建的频率是多少?如果它们还没有,则应扩充现有的配置流程以添加this TechNet blog post中描述的相关RFC2307属性.对于手动创建的straggler,您可以让脚本以您喜欢的任何时间间隔运行,查找缺少的对象属性并根据需要填充它们.

在我们的环境中,我们在DC上持有PDC模拟器角色每5分钟运行一次脚本.但我们可能会将其降低到每分钟一次而没有太大的额外影响.我们还根据基于对象SID的算法生成UID / GID值,而不是简单的自动递增值.它的好处是它们在域/林之间是唯一的保证*我们不需要进行任何查找来查找下一个值或确保我们想要使用的值尚未使用.如果你愿意,我可以发布这个功能.但听起来你们可能已经有了自己的系统.

*保证=尽可能保证不会使用相同的随机生成的域ID创建两个域.

编辑:根据请求,这是我们用于从SID生成UID / GID的Powershell函数.

function Get-UIDFromSID(){    [CmdletBinding()]    param(        [Parameter(Mandatory=$true,position=0,ValueFromPipeline,ValueFromPipelineByPropertyname)]        [System.Security.Principal.SecurityIDentifIEr]$sID    )    # convert sID to byte array    $sIDBytes = New-Object byte[] $sID.BinaryLength    $sID.GetBinaryForm($sIDBytes,0)    Write-Verbose ("SID bytes: $([System.BitConverter]::ToString($sIDBytes))")    # copy the sections we need    $rIDDomainBytes = New-Object byte[] 8    [System.Array]::copy($sIDBytes,16,$rIDDomainBytes,4)    $rIDUserBytes = New-Object byte[] 8    [System.Array]::copy($sIDBytes,24,$rIDUserBytes,4)    Write-Verbose ("Domain portion: $([System.BitConverter]::ToString($rIDDomainBytes))")    Write-Verbose ("User portion: $([System.BitConverter]::ToString($rIDUserBytes))")    # fix endian'ness if necessary    if (![System.BitConverter]::IslittleEndian)    {        [System.Array]::Reverse($rIDDomainBytes)        [System.Array]::Reverse($rIDUserBytes)    }    # convert the byte arrays to longs    $rIDDomain = [System.BitConverter]::ToInt64($rIDDomainBytes,0);    $rIDUser = [System.BitConverter]::ToInt64($rIDUserBytes,0);    Write-Verbose "Domain(Int64) = $rIDDomain,User(Int64) = $rIDUser"    # Now we're going to use the first 9 bits of the domain rID followed by the    # first 22 bits of the user rID to make a single 31 bit integer (32-bit signed)    # that will be the new unique UID value for this SID    $rIDDomain = ($rIDDomain -band 0x1ff) -shl 22    $rIDUser = $rIDUser -band 0x3fffff    Write-Verbose "Domain(Int64) = $rIDDomain,User(Int64) = $rIDUser"    return ($rIDDomain + $rIDUser)<#.SYnopSIS    Calculate the UID value for a windows SID..DESCRIPTION    This function duplicates Centrify's algorithm for generating unique UID    values for Active Directory users and groups. The original algorithm was    provIDed by Centrify and ported to PowerShell by Ryan Bolger..ParaMETER sID    The SecurityIDentifIEr (SID) object to calculate against..OUTPUTS    system.int32 value of the resulting UID..EXAMPLE    Get-UIDFromSID ([System.Security.Principal.SecurityIDentifIEr]'S-1-5-21-3040497277-3966670145-4188292625-1137')    Calculate a UID from a fictional SID..EXAMPLE    Get-ADUser myuser | Get-UIDFromSID    Calculate a UID from an existing Active Directory user via pipeline input.#>}
总结

以上是内存溢出为你收集整理的linux – AD插件或实用程序,在创建时生成唯一的uidnumber / gidnumber全部内容,希望文章能够帮你解决linux – AD插件或实用程序,在创建时生成唯一的uidnumber / gidnumber所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/1038828.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)

保存