Sapien powershell studio datagrid invoke-sqlcmd
Project Euler and PowerShell - Problem 2.Project Euler and PowerShell - Problem 3.Project Euler and PowerShell - Problem 4.Project Euler and PowerShell - Problem 5.Project Euler and PowerShell - Problem 6.Project Euler and PowerShell - Problem 7.Get-Content $f Get-DriveInventory Export-Csv "C:\Users\Public\Documents\DriveInventory.csv"
$computer = Read-Host "Filename of computer names?" $obj Add-Member NoteProperty TotalSpace $total $obj Add-Member NoteProperty AvailableSpace $free $obj Add-Member NoteProperty VolumeName $drive.VolumeName $obj Add-Member NoteProperty DriveLetter $viceid $obj Add-Member NoteProperty ComputerName $_ $drives = gwmi win32_logicaldisk -comp $_ -filter "drivetype=3" Now if I could only find a way to get the file count. Was recently asked to retrieve hard drive (type=3) information from a supplied list of servers for backup planning.įollowing is a script used to gather this information. Output " file://intapp-p2/e$/Inetpub/Extranet/ProjectManager/Exception/ASPNet_WP.png" $b Out-Chart -Values Intapp-p2, webster-vp01, Webster-vp02 ` $b = Import-Csv "c:\ProductionScripts\ASPNet_WP.csv" select -last 28 # Grab the data (last 7 hours worth) and chart! Where-Object " -f $dt,$intappp2,$webstervp01,$webstervp02Īdd-Content -Path "c:\ProductionScripts\ASPNet_WP.csv" -Value $str ComputerName intapp-p2 -Credential $creds ` $intapp_p2 = Get-WmiObject -Class Win32_Process ` # Get WorkingSetSize for the 3 NT3OSUMC servers argumentlist "nt3osumc\stah06",$password
$password = Get-Content c:\cred.txt ConvertTo-SecureString # we won't have to worry about the creds. # Once these servers are moved into the correct domain # Description: PowerShell Script for ASPNet_WP In the short-term, if you are interested in the script(s), send me a note at Script Name: Get-ASPNet_WP.ps1
#SAPIEN POWERSHELL STUDIO DATAGRID INVOKE SQLCMD HOW TO#
The results are then passed to the datagrid.Īs soon as I figure out how to attach a text file to Blogger, I will do so. Selecting the above variables generates the SQL statement to the VPX_EVENT table. The dropdowns are filled on the form load with the following: The UI was simple to create with PrimalForms, here is a screenshot of the UI. Once I saw Alan's post, I knew it would be a good example to try PrimalForms with. I mentioned this to Alan and he quickly wrote a PowerShell script to find the data and blogged it.Ĭoncurrently, I was investigating PrimalForms (PowerShell UI builder - FREE). I know that this data was kept in the Virtual Center Database, specifically in the VPX_EVENT table. He was asking if there was a log file that could be parsed to search for who deleted a VM. Recently saw a post on Twitter from alanrenouf. $SqlVMDataTable Export-Csv ' L:\DRDocs\BBPins.csv ' -noTypeInformation ConnectionString = " Server = YourServer Database = YourDB User ID=YourID Password=YourPWD Integrated Security = False " Right(MailboxDN,(LEN(MailboxDN)-CHARINDEX('s/cn=', MailboxDN)-4)) AS SamAccountName $SQLQuery = " SELECT DisplayName,PIN,CreationTime,MailboxSMTPAddr, Following is a small script that I have scheduled to run once a week: I then remembered that all the data resides in SQL Server diligently waiting to be queried. I looked on the BlackBerry server for a few minutes hunting for a way to do it from the server. This "report" would be used for communication purposes in a Disaster situation. Was asked yesterday if I could write something that would periodically generate a CSV file of our BlackBerry users and their pin numbers.