2023/04/26

連接網路磁碟帶上帳號密碼直接連線

 連線網路磁碟機時,若需要 網域\帳號 + 密碼 來進行連線,該如何免輸入直接登入連線

net use X: \\server_ip\share_folder  /user:domain\UserName UserPass

例如:

net use w: \\10.1.2.3\public /user:tsmc\xman  XmanPass

~END

2023/04/19

匯出AD網域所有使用者密碼更新日期、到期日期

 

此為 powershell 執行片段,可以將下方程式碼存於 c:\ss\get_user_pwd_expire.ps1,然後以管理者執行 powershell (以一般 powershell 可能會取出空值),最後會將結果寫入到 c:\ss\get_user_pwd_expire.log 記錄檔

date > c:\ss\get_user_pwd_expire.log

Get-ADUser -filter {Enabled -eq $True -and PasswordNeverExpires -eq $False} -SearchBase "OU=Lala-Users,DC=lala,DC=com" -Properties "DisplayName", "msDS-UserPasswordExpiryTimeComputed","passwordlastset","Passwordneverexpires","LockedOut" | Select-Object -Property "Displayname","passwordlastset",@{Name="ExpiryDate";Expression={[datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")}},"Passwordneverexpires","LockedOut" | ft >> c:\ss\get_user_pwd_expire.log


請將標記紅色字部分改為適合自己的內容。


Reference:https://blog.dino9021.com/2021/10/ou.html 

~END

Blog 重新開始吧

20070321 開始在 xuite 寫Blog,經過了16年突然被通知要關站了,連家大業大的 Hinet也敵不過時代潮流,反正...就改個地方寫吧!
 紀念 
期間:20070321 ~ 20230831 
20230419:11531442人次,文章1300篇左右 

 就改換這邊來寫吧...試試看囉~

Ubuntu 如何查看及變更時區 TimeZone

使用指令 timedatectl 查看目前 ubuntu 的時區設定 $ timedatectl 列出所有 Asia 的時區 $ timedatectl list-timezones | grep Asia 變更時區為 Asia/Taipei $ sudo timedatectl...