2022/10/31

7zip 壓縮檔案指令

為了想要定期把一些檔案壓縮成一個檔案,所以就想到要用batch加排程的方式。

7zip有提供相關的指令可以做

指令如下,

7z a d:\backup[%DATE:~0,4%-%DATE:~5,2%-%DATE:~8,2%].7z  @d:\list.txt 

第一欄(7z) - 就是執行程式的名稱,最好是用完整路徑

第二欄(a) - 就是要壓縮的意思

第三欄(d:\xxx) - 就是壓縮檔的名稱,上面的範例是檔名會自動產生當天的日期,後面的副檔名也可以改用zip

第四欄(@:xxx) - @後面要接一個文字檔,這個文字檔裡就列出要壓縮的檔案存放的路徑,所以有3個不同資料夾的檔案要壓在一起,就把三個路徑分三行存在文字檔裡就行了。

以上就是batch檔的內容。



7zip File Compression Command


In order to periodically compress files into a single archive, I decided to use batch scripting along with scheduled tasks. Fortunately, 7zip provides relevant commands to achieve this.

The command is as follows:

7z a d:\backup[%DATE:~0,4%-%DATE:~5,2%-%DATE:~8,2%].7z @d:\list.txt

Here is a breakdown of the command:

The first field (7z) represents the name of the executable program. It is recommended to use the full path to the program.

The second field (a) indicates the action of compressing.

The third field (d:\xxx) specifies the name of the compressed file. In the example above, the file name will be automatically generated based on the current date. You can also change the file extension to .zip if desired.

The fourth field (@:xxx) specifies a text file. This text file contains the paths of the files to be compressed. So, if you have files from three different folders that need to be compressed together, you can list the three paths on separate lines in the text file.

The above instructions can be included in a batch file to automate the process.

2022/10/19

發信通知AD帳號 密碼快到期的人

 windows系統內建的提醒實在太小了,就縮在右下角,而且預設兩週前會天天提醒,到剩一週後,就不會在顯示了,使用者早就忘了,所以需要一個比較顯示的提示。

 可以參考這個下列這個powershell,就可以執到此功能,裡面程式碼有夠多,但只要先把要搜尋的dc位置,mail server位置,管理者信箱這3個設定值,調成自己環境內的資訊,就可以執行測試了。

預設是測試模式,所以只會寄給管理者,測試ok後再關閉測試模式,通知信就會發給使用者了,不需要修改太多東西就可以用了,讚。

https://gist.github.com/meoso/3488ef8e9c77d2beccfd921f991faa64#file-example-com-password-expiration-notifications-ps1



Notifying Users of Expiring Passwords via Email in Active Directory

The default built-in password reminder in Windows is quite inconspicuous, residing in the bottom right corner. Additionally, it only displays reminders every day up to two weeks before the expiration date. Once there is only one week left, the reminder disappears, and users tend to forget about it. Therefore, a more prominent notification is needed.

You can refer to the following PowerShell script to achieve this functionality. Although the code may seem extensive, you only need to adjust three configuration values: the location of the domain controller (DC), the mail server, and the administrator's email address. Once you set them according to your environment, you can execute a test run.

By default, the script runs in test mode, sending notifications only to the administrator. After confirming that it works correctly, you can disable test mode, and the notifications will be sent to the users. It requires minimal modifications, making it easy to use.

You can find the PowerShell script at the following link:

https://gist.github.com/meoso/3488ef8e9c77d2beccfd921f991faa64#file-example-com-password-expiration-notifications-ps1

2022/10/07

outlook 收件都變成純文字格式

 outlook正常的話,收進來的信會是html格式。

如果信突然都變成文字格式,就是設定被調到,改回來就行了,就在信任中心裡有個以純文字讀取所有標準郵件,取消就行了。


















Outlook emails are appearing as plain text format.
In a normal Outlook setup, incoming emails are displayed in HTML format.

If suddenly all emails are appearing as plain text, it means that a setting has been changed. To revert back to the original format, follow these steps:

Open Outlook and go to the Trust Center.
Look for the option "Read all standard mail in plain text" within the Trust Center settings.
Uncheck this option to disable plain text reading for all standard emails.
Once you have made this change, Outlook will display emails in their original format again.

選擇權單賣 慘啊

 最近兩個月真的就是上下刷,做單賣當沖實在慘,一直打到停損,超累的。

還好都有控制好停損,至少都沒大賠。