我有一个脚本创建一个用户并将密码和用户分配给一个组,但我需要勾选2个复选框 - "用户无法更改密码"和"密码永不过期",但对于我的生活我无法找到这该怎么做.
到目前为止我的脚本是这样的: -
# Create User and add to IGNITEWEBUSERS Group
$user = $domain
# If more then 15 chars trim to just 15 chars
$user = $user.substring(0, 15)
$user = $user + "_web"
# Generate Random Complex Password
# Generate a password with 2 non-alphanumeric character.
$Length = 10
$Assembly = Add-Type -AssemblyName System.Web
$RandomComplexPassword = [System.Web.Security.Membership]::GeneratePassword($Length,2)
$password = $RandomComplexPassword
$group = 'IGNITEWEBUSERS'
$objOu = [ADSI]"WinNT://$computer"
$objUser = $objOU.Create("User", $user)
$objUser.setpassword($password)
$objUser.SetInfo()
$objUser.description = $domain + " …Run Code Online (Sandbox Code Playgroud) 我有一张表,上面有注册情况和注册日期。我想运行一个查询,给出每天总注册量的输出。
我有以下查询:
SELECT COUNT(dtm_SignUpDate) as TotalSignUpsPerDay, dtm_SignUpDate as Count_Date
FROM tbl_Account
GROUP BY DATEADD(dd, 0, DATEDIFF(dd, 0, dtm_SignUpDate))
Run Code Online (Sandbox Code Playgroud)
但得到
列“tbl_Account.dtm_SignUpDate”在选择列表中无效,因为它未包含在聚合函数或 GROUP BY 子句中。
我需要改变什么才能让它发挥作用。
我点击了此链接(每个日期的 SQL 计数),但它仍然出现与上述相同的错误。