This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Configuration LCMPullConfig | |
| { | |
| LocalConfigurationManager | |
| { | |
| ConfigurationID = "EXCH"; | |
| RefreshMode = "PULL"; | |
| DownloadManagerName = "WebDownloadManager"; | |
| RebootNodeIfNeeded = $true; | |
| RefreshFrequencyMins = 30; | |
| ConfigurationModeFrequencyMins = 30; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # Your Configuration | |
| Configuration ExchangeService { | |
| # Parameters | |
| # Accepts a string value computername or defaults to localhost | |
| Param([string[]]$ComputerName = "localhost") | |
| # Target Node | |
| Node $ComputerName { | |
| # Service Resource | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # Step 1 Install xPSDesiredStateConfiguration | |
| Install-Module -Name xPSDesiredStateConfiguration | |
| # Step 2 | |
| # Create the Pull Server. | |
| Configuration CreatePullServer { | |
| param ( | |
| [string[]]$ComputerName = 'localhost' | |
| ) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # Get all the DSC CMDLets | |
| Get-Command -Noun dsc* | |
| # Get Available Resources | |
| # Refer to powershellgallery.com for additional resources | |
| Get-DscResource | |
| # What can we configure for each resource | |
| Get-DscResource File | Select -ExpandProperty Properties | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # Your Configuration | |
| Configuration ExchangeService { | |
| # Parameters | |
| # Accepts a string value computername or defaults to localhost | |
| Param([string[]]$ComputerName = "localhost") | |
| # Target Node | |
| Node $ComputerName { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <# | |
| DESCRIPTION | |
| This script will search a file structure for a specific file type and export the results to a CSV file. | |
| This can be used to search a user accessible file share for file types that you may have policies | |
| against storing on a file share. If you don’t have access to Enterprise tools like FSRM this is an | |
| easy way to provide similar functionality. | |
| #> | |
| #This is what Directory you want to search | |
| $searchDir = "c:\files" | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <# | |
| DESCRIPTION | |
| Use WMI to gather hardware and software information remotely from domain clients. | |
| The script pings a list of computernames and runs the inventory on livePCs.txt. | |
| Once all the hardware/software information is collected, all the data is exported | |
| to a CSV file. | |
| PARAMETER | |
| No parameters, just change the execution policy and run the script | |
| #> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <# | |
| DESCRIPTION | |
| Use WMI to gather hardware and software information remotely from domain clients. | |
| The script pings a list of computernames and runs the inventory on livePCs.txt. | |
| Once all the hardware/software information is collected, all the data is exported | |
| to a CSV file. | |
| PARAMETER | |
| ComputerName(s), see the examples below. | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <# | |
| DESCRIPTION | |
| Searches all OUs in Active Directory, or a subset of OUs and looks for the | |
| ProtectedFromAccidentalDeletion property is set to $false. | |
| The code at the bottom of the script will find the OUs and set them to | |
| Protectedfromaccidental $true | |
| #> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <# | |
| DESCRIPTION | |
| Retrieve the username of the user that logged into a computer last. | |
| #> | |
| # Option 1 | |
| $computer = 'dc1' | |
| Get-ChildItem "\\$computer\c$\Users" | Sort-Object LastWriteTime -Descending | Select-Object Name, LastWriteTime -first 1 | |
| # Option 2 | 
OlderNewer