Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
Managing Windows systems involves a variety of tasks such as user management, file system management, network configuration, and system monitoring. In this article, we will explore how to effectively manage these aspects using Command Prompt (CMD) and PowerShell, providing practical examples and sample scripts.
To create a new user in Windows, you can use the net user
command in CMD.
Example:
net user JohnDoe Pa$$w0rd /add
This command creates a new user named JohnDoe with the password Pa$$w0rd.
To add a user to a group, use the net localgroup
command.
Example:
net localgroup Administrators JohnDoe /add
This command adds the user JohnDoe to the Administrators group.
To list files and directories, you can use the dir
command in CMD.
Example:
dir C:\Users\JohnDoe\Documents
This command lists all files and directories in the specified path.
To change file permissions, you can use the icacls
command.
Example:
icacls C:\Users\JohnDoe\Documents\example.txt /grant JohnDoe:F
This command grants full control (F) to the user JohnDoe for the file example.txt.
To display network configuration details, use the ipconfig
command.
Example:
ipconfig /all
This command displays all network configuration details for the system.
To configure an IP address, you can use the netsh
command.
Example:
netsh interface ip set address "Local Area Connection" static 192.168.1.100 255.255.255.0 192.168.1.1
This command sets a static IP address for the Local Area Connection.
To check system uptime, you can use the systeminfo
command.
Example:
systeminfo | find "System Boot Time"
This command retrieves the system boot time, which can be used to calculate uptime.
To monitor running processes, use the Get-Process
cmdlet in PowerShell.
Example:
Get-Process
This command lists all running processes on the system.
To create a scheduled task, you can use the New-ScheduledTask
cmdlet in PowerShell.
Example:
$action = New-ScheduledTaskAction -Execute "PowerShell.exe" -Argument "-NoProfile -WindowStyle Hidden -File C:\Scripts\Backup.ps1"
$trigger = New-ScheduledTaskTrigger -Daily -At 3AM
Register-ScheduledTask -Action $action -Trigger $trigger -TaskName "DailyBackup" -Description "Daily backup task"
This script creates a scheduled task named "DailyBackup" that runs a PowerShell script daily at 3 AM.