Question

In: Computer Science

Using PowerShell ISE or VSCode, create a PowerShell script that will do the following: Create functions...

Using PowerShell ISE or VSCode, create a PowerShell script that will do the following:

  1. Create functions to get the following information
    1. Local username
    2. Local machine name
    3. Time zone
    4. Current Date
  2. Output the data that was collected to the screen

Upload the script. Paste a screenshot of the results here

Solutions

Expert Solution

I below is the code and output screens

#we are witing functions and calling them to get desired output

#note-make sure that the running the scripts shouls be enabled in your host system

#this is the function to find usernames in the current system

function getmyusername{
$(Get-LocalUser)
}

#calling the above function
Write-Output "The username is"
getmyusername


Write-Output "            "
#this is the function to find timezone 
function getmytimezone{
$(Get-TimeZone)
}


#calling the above function
Write-Output "The timezone is"
getmytimezone

#this is the function to find the date
function getthedate{
#using the displayhint 
$(Get-Date -DisplayHint Date)
}


#calling the above function
Write-Output "The date is"
getthedate


#this is the function to find machinename in the current system
function getmymachinename{
#using environmentvaraibles
$([system.environment]::MachineName)
}


#calling the above function
Write-Output "The machinename is"
getmymachinename


Related Solutions

Using PowerShell ISE or VSCode, create a PowerShell script that will do the following: You are...
Using PowerShell ISE or VSCode, create a PowerShell script that will do the following: You are going to create an HTML web page report from a standard processed report. You will use the text file “STUDENTS.TXT” located on Canvas. The script must meet the following requirements: The output file should be named ITS3410-{your name}.htm Every line of data that has a student number (9999-9999) must be included in the report All data must be trimmed No leading white space No...
In PowerShell ISE create a script. Use the text file “its3410Users.txt” (found on Canvas) and import...
In PowerShell ISE create a script. Use the text file “its3410Users.txt” (found on Canvas) and import the users into your domain controller. The user file has a first name, last name, and department. Using this information, create users with the following specifications: Username will be first name.last name User Principal Name will be first name.last [email protected] The department signifies the OU that the user will be placed into If the department does not exist, create it Fill in the first...
1. How to create a group of users using a PowerShell script. 2. how to create...
1. How to create a group of users using a PowerShell script. 2. how to create a file consisting a group of 3 new user name’s and passwords, 1 to a line in power shell. 3. How to write a script in power shell to delete specific group of users. Prove that it works.
Write a Powershell script to create a Windows user account that is a non-admin user. This...
Write a Powershell script to create a Windows user account that is a non-admin user. This assignment assumes that you already have a Windows VM, with the administrator account created.. To complete the assignment, write the PowerShell script, run it on your VM, and submit the script here.
Write Powershell Script Verifies System Environment Variable Lmlicensefile Exists Exists S Q42980878 write a PowerShell script...
Write Powershell Script Verifies System Environment Variable Lmlicensefile Exists Exists S Q42980878 write a PowerShell script that verifies the 'System' environmentvariable, 'LM_LICENSE_FILE', exists. If it exists, the scriptshould also verify that the variable [email protected] (which represents the port and server theLM points to) as one of the values in the variable. Values (if anyare present) are separated by commas "," in this variable. Finally,if the value does not exist, this script should also performremediation (add the desired value to the...
Using Matlab functions ‘fdesign’ and ‘design’, create the following filters (do not forget to create an...
Using Matlab functions ‘fdesign’ and ‘design’, create the following filters (do not forget to create an m file to write a script that should be printed in your report). [0.5] a-c each (a) Low pass Hamming and low pass Hann filters, with cut off frequency Fc=300 Hz, sampling frequency Fs=2000 Hz, filter order N=100. Plot both filters on the same graph and use legend in the figure to mark each filter. Comment on the figure. (b) Low pass Hamming filter...
Windows PowerShell 1) Write a PowerShell Script to monitor a file for changes. 2) Write a...
Windows PowerShell 1) Write a PowerShell Script to monitor a file for changes. 2) Write a PowerShell Script to create a user account in a specific OU.
Write a script in C that will do the following : 1. Create the directory ZHW3....
Write a script in C that will do the following : 1. Create the directory ZHW3. 2. Verify that the directory is created by display all information related to the directory and not just the name of the directory. 3. Assume that the input from the command is used to validate password strength. Here are a few assumptions for the password string. • Length – minimum of 8 characters. • Contain alphabets , numbers , and @ # $ %...
Write a PowerShell script which will prompt user to enter the number of the day of...
Write a PowerShell script which will prompt user to enter the number of the day of the week (e.g. 1,2,3,4,5,6,7) and return the day of the week. (e.g. Sunday...etc.) (Hint: Sunday is the 1st day of the week).
Use a powershell script to bulk create 10 users (sales1, sales2, ...) inside OU=MyBusiness, OU=Users, OU=Sales,...
Use a powershell script to bulk create 10 users (sales1, sales2, ...) inside OU=MyBusiness, OU=Users, OU=Sales, save script to desktop
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT