Soluții

Powershell script sterge o lista de utilizatori din mai multe grupuri in acelasi timp

$users = import-csv C:\Users\admin.costeami\DesktOp\NRT-TEST.CSV
$groups = Get-ADGroup -Filter {Name -like “*_SB_*”} |select -ExpandProperty name
Foreach ($group in $groups) {
Foreach ($user in $users) {
Try{
#Set-ADUser $user.samaccountname -Description “Was member of $group”
Remove-ADPrincipalGroupMembership $user.samaccountname -member $group -confirm:$false -ErrorAction Stop
Write-Host “removing $($user.samaccountname) from $group” -ForegroundColor green
Write-Output “User $($user.samaccountname) removed from $group ” |Out-File “C:\Users\admin.costeami\Desktop\NRT-TEST2.txt” -Append
}

Catch
{write-warning “$_ Error removing user $($User.samaccountname)”}
}
}

[mai mult...]

Powershell Script, adauga un user ca admin local pe mai multe statii dintr-un fisier .txt

#Define variables
$computers = Get-Content d:\scripts\Computers.txt
#$computers = Import-CSV Computers.csv | select Computer
$username = “admin.w11”
$password = “Pa$$w0rd”
$fullname = “Fullname”
$local_security_group = “Administrators”
$description = “Description”

Foreach ($computer in $computers) {
$users = $null
$comp = [ADSI]”WinNT://$computer”

#Check if username exists
Try {
$users = $comp.psbase.children | select -expand name
if ($users -like $username) {
Write-Host “$username already exists on $computer”

} else {
#Create the account
$user = $comp.Create(“User”,”$username”)
$user.SetPassword(“$password”)
$user.Put(“Description”,”$description”)
$user.Put(“Fullname”,”$fullname”)
$user.SetInfo()

#Set password to never expire
#And set user cannot change password
$ADS_UF_DONT_EXPIRE_PASSWD = 0x10000
$ADS_UF_PASSWD_CANT_CHANGE = 0x40
$user.userflags = $ADS_UF_DONT_EXPIRE_PASSWD + $ADS_UF_PASSWD_CANT_CHANGE
$user.SetInfo()

#Add the account to the local admins group
$group = [ADSI]”WinNT://$computer/$local_security_group,group”
$group.add(“WinNT://$computer/$username”)

#Validate whether user account has been created or not
$users = $comp.psbase.children | select -expand name
if ($users -like $username) {
Write-Host “$username has been created on $computer”
} else {
Write-Host “$username has not been created on $computer”
}
}
}

Catch {
Write-Host “Error creating $username on $($computer.path): $($Error[0].Exception.Message)”
}
}

[mai mult...]

WC-40382-7 Cod de eroare de facturare PlayStation

Dacă ați primit acest cod de eroare atunci când încercați să plătiți cu cardul dvs. de credit sau debit pentru achiziții în rețeaua PlayStation ™, este posibil să întâmpinați o problemă cu informațiile despre cardul dvs. de credit sau debit din contul dvs. din rețeaua PlayStation ™.Primești codul de eroare WC-40382-7, deoarece informațiile despre cardul de credit sau debit stocate pe contul tău în rețeaua PlayStation ™ sunt invalide.

[mai mult...]

Ext4 vs. Btrfs: Which Linux File System Should You Use?

Quite honestly, not enough people consider which file system to use for their computers.

Windows and macOS users have little reason to look, since they really have only one choice for their system—NTFS and HFS+, respectively. Linux, on the other hand, has plenty of different file system options, with the current default being the Fourth Extended Filesystem (ext4). There’s an ongoing push to change the default file system to the B-Tree File System (btrfs). But is btrfs better, and when will we see distributions making the change?

[mai mult...]