Ashkanph / md-to-html

A web based markdown (md) to html converter
http://ashkanph.github.io/md-to-html
MIT License
17 stars 7 forks source link

cant properly convert this file to html if you can track down the problem #5

Open Vibhu2 opened 3 years ago

Vibhu2 commented 3 years ago

<h1 align="Center";p style="color:blue";>My collection of Powershell Snippets

  1. To get last boot time of the machine.
    (get-date) - (Get-ComputerInfo).OsLastBootUpTime

    or

      (Get-ComputerInfo).OsLastBootUpTime       

    or

      (Get-CimInstance Win32_OperatingSystem).LastBootUpTime
  2. To get list of stopped services.
    Get-Service | Where-Object {$_.Status -eq "Stopped" -and $_.Starttype -eq "Automatic"}
  3. Setting execution Policy on machine.
    Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
  4. Find Drive space.
    Get-PSDrive -PSProvider FileSystem
  5. Get Free Space for System Drive.
    (Get-PSDrive $Env:SystemDrive.Trim(':')).Free/1GB
  6. Check BIOS information.
    (Get-CimInstance Win32_BIOS)
  7. Check computer information
    Get-CimInstance Win32_ComputerSystem 
  8. Check printer information on a machine.
    Get-CimInstance Win32_Printer | Select-Object Name, PortName, Default| Format-List
  9. Keep System Awake ( VB ) Script.
    set wsc = CreateObject("WScript.Shell")
    Do
    'Five minutes
    WScript.Sleep(5*60*1000)
    wsc.SendKeys("{F13}")
    Loop
  10. Install Powershell using chocolaty.
    
    Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

choco install powershell -force --yes choco install powershell-core -force --yes Start-Sleep -Seconds 90 exit exit

11. Installing winget on a machine using commandline.
```powershell
invoke-webrequest
  1. Checking who rebooted a production server.

    Get-EventLog –Log System –Newest 100 | Where-Object {$_.EventID –eq ‘1074’} | FT MachineName, UserName, TimeGenerated -AutoSize
  2. check Computer domain

    (Get-CimInstance Win32_ComputerSystem).Domain
  3. Restart LTServices.

    Restart-Service -Name ltsvcmon
    Restart-Service -Name labvnc
    Restart-Service -Name ltservice
    Stop-Process -Name ltsvcmon.exe -Force
    Stop-Process -Name ltsvc.exe -Force
    Stop-Process -Name lttray.exe -Force
    Stop-Process -Name labvnc.exe -Force
    Stop-Process -Name labtechupdate.exe -Force

    Active Directory one liners

Before running any ActiveDirectory commands we need to import Ad-Module.

Import-Module ActiveDirectory

  1. Get All Members of a Group by name and ID
    Get-ADGroupMember -Identity <group_name> -Recursive | select name,SamAccountName
    1. Finding inactive users (no activity for 195 days or more)
      
      write-Host "Getting inactive User accounts the are enabled" n

$inacUser = Search-ADAccount -AccountInactive -TimeSpan $tspan -UsersOnly |Where-Object { $_.Enabled -eq $true } |select name,DistinguishedName,LastLogonDate

Write-host $inacuser.count -foreground Green “Number of inactive user accounts that are enabled”

3. Finding New Users created in last 7 days.
```Powershell
write-Host "Getting users created within a week." n

$ADuserInWeek = Get-ADUser -Filter {whenCreated -ge $week} -Properties Whencreated | select Name,whenCreated,DistinguishedName

Write-Host $ADUserinweek.count -ForegroundColor Green “Number of users created in the last 7 days” `n
  1. Find Domain Controllers on Your Domain.
    Resolve-DnsName -Type ALL -Name _ldap._tcp.dc._msdcs.$env:userdnsdomain
  2. List Software Available for Uninstall .
    Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table
  3. Install PowerShell Core (6 and 7).
    Invoke-Expression "& { $(Invoke-RestMethod -Uri aka.ms/install-powers…) }" -UseMSI -Preview
  4. Get ADuser last logon information of all the users
    Get-ADUser -Filter {enabled -eq $true} -Properties LastLogonTimeStamp | Select-Object Name,@{Name="Stamp"; Expression={[DateTime]::FromFileTime($_.lastLogonTimestamp).ToString('dd-MM-yyyy_hh:mm:ss')}}
  5. Back up all production Group Policy Objects
    Backup-GPO –All –Path C:\Temp\AllGPO
Ashkanph commented 3 years ago

Hey @Vibhu2, there were some problems with your markdown that I fixed them; You can test again with this attached markdown file.

But my md-to-html doesn't support the markdown Blockquotes. So you will not see the following line similar to Github preview:

Import-Module ActiveDirectory

Vibhu2.md

Vibhu2 commented 3 years ago

Thanks a lot for your prompt responce