jueves, 16 de noviembre de 2017

WINDOWS. PS. Mail by default

[ ] Introduction

I have a lot of user at my Exchange, all users have more of one email, for O365 project I need assign one specific default email.

I prepared one list with a login name and the new default email account.


[ ] The script

**********************************

# Import AD Module
#Import-Module ActiveDirectory

#Si queremos hacer un BAckup antes:
#Get-Mailbox -ResultSize Unlimited |Select-Object DisplayName,PrimarySmtpAddress > Backup

#Log
$LogFile = "C:\scripts\O365\EmailDefault\logUpdates.txt"

write-Host 'Starting to update AD Attributes.......' -NoNewline -ForegroundColor Yellow
write-Host "`r`n"

# Import CSV into variable $LIST_users

#fICHERO DE USUARIOS A ACTUALIZAR
$LIST_users = Import-Csv C:\scripts\O365\EmailDefault\UserList.TXT -delimiter ";"
# Loop through CSV and update users if the exist in CVS file

$LIST_users|Foreach{


Write $_.Login
Write-output "`n++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++`r`n" >> $LogFile
        Write-output $_.Login | out-file -filepath $LogFile -append
Write-output "`n====================================================================`r`n" >> $LogFile
Set-Mailbox $($_.Login) -Primarysmtpaddress $($_.DefaultAddress) -confirm:$false -Emailaddresspolicyenable $False 2>> $LogFile


}

Write-Host 'done!' -ForegroundColor Green

*********************************

[ ] The Log

For check I can verify my log ($LogFile = "C:\scripts\O365\EmailDefault\logUpdates.txt") with the results.



Check at Exhange 2007
by GoN | Published: November 16, 2017 | Last Updated:

viernes, 3 de noviembre de 2017

WINDOWS. PS. Easy uptade user attributes.

I explain a simple and quicly script to update user AD attributes. At this example update 3 atributes from AD users

[ ] Source txt tributes:

LOCATION_NAME , COMPANY_NAME, LOCATION_ADDRESS


Source user data: C:\tmp\Upgradeusersdata\users.csv

[ ] Destination AD atributes

Office, Company, StreetAddress




[ ] Script:


/***********************************************************************/
# Import AD Module
Import-Module ActiveDirectory

$Delimiter = ";"

write-Host 'Starting to update AD Attributes.......' -NoNewline -ForegroundColor Yellow
# Import CSV into variable $LIST_users

$LIST_users = Import-Csv C:\tmp\Upgradeusersdata\users.csv $Delimiter
# Loop through CSV and update users if the exist in CVS file

$LIST_users|Foreach{

Set-ADUSer -Identity $_.Login -Office $_.LOCATION_NAME -Company $_.COMPANY_NAME -StreetAddress $_.LOCATION_ADDRESS
Write $_.Login

}

Write-Host 'done!' -ForegroundColor Green


/***********************************************************************/

The "-Identity" will be our index.

Check at Windows 2012 R2
by GoN | Published: November 3, 2017 | Last Updated:

martes, 10 de octubre de 2017

CISCO. How to access a switch with limited permissions



I explain how to create one user to acces to switch with limited permitions, for example for create one network opertator or Help desk user.



Configure Switch. Commands:

aaa new-model
aaa authentication login default local
aaa authorization exec default local

privilege interface level 10 duplex
privilege interface level 10 speed
privilege interface level 10 shutdown
privilege interface all level 10 switchport
privilege interface level 10 description
privilege interface level 10 no duplex
privilege interface level 10 no speed
privilege interface level 10 no shutdown
privilege interface all level 10 no switchport
privilege interface level 10 no description
privilege interface level 10 no
privilege configure level 10 interface
privilege exec level 10 configure terminal
privilege exec level 10 configure
privilege exec level 10 show mac
privilege exec level 10 show arp
privilege exec level 10 show running-config interface
privilege exec level 10 show logging
privilege exec level 10 show interfaces

privilege exec level 10 show

Configure User. Asign user privileges. Commands:

(config)# username NOMBRE privilege 10      
   

With this configuration the user Jxxxx can to access to privilege 10 and lower

Other example. Commands:

username gontest privilege 5 password gontest
privilege exec level 4 show running-config view full


Check at 2960/ 3780 SW 
by GoN | Published: October 10, 2017 | Last Updated: