It happened once that i needed to provision a Sharepoint 2013 farm including MS SQL Server Reporting Services (SRSS). I had some issues – maybe you found this post ‘cos of that – which i would also share and give a hint on the solution.
The security is important; working for a huge company sometimes causes problems. You get less right, because of the security. If you a normal user, and you would like to check if one of the user enabled for OCS without Admin rights or Universal Server Administrator right. A normal domain user can check it, because the AD readable for all AD users.
Filedialog and Powershell
When I ask any input from a user in Powershell script most of the time I ask it in a parameter of the script body or just prompt for it during runtime. But with the underlying .NET Framework you can take advantage of the GUI, for example using a dialog panel. By using a dialog to specify a file you can be sure, that there is no spelling mistake in the path and you also provide a better user experience.
That’s a simple one but good to have
$file = “MYFILE.TXT”
$smtpServer = “MYSMTPSERVER.EMAIL.CO.UK”
$msg = new-object Net.Mail.MailMessage
$att = new-object Net.Mail.Attachment($file)
$smtp = new-object Net.Mail.SmtpClient($smtpServer)
$msg.From = “FROMME@EMAIL.CO.UK” #reply-to-address
$msg.Sender = “Csoma Ádám” #From field
$msg.To.Add(“TOME@EMAIL.CO.UK“) #send-to part
$msg.Subject = “MY SUBJECT”
$msg.Body = “MY TEXT FOR THE EMAIL”
# To authentaicate at the mail server you need to use the next line
# $smtp.Credentials =[System.Net.CredentialCache]::DefaultCredentials
This is not a fairy tale at all 🙂 just think on the regional settings…
Issue: Get data from a cell
First of all for this exmample an excel application should be installed to the machine. So here are some lines to get the data from a sheet (A1 cell)
Another quest in Sharepoint automatization is to get the selected values for a given multiselect field. We could start in the usual way as to get the given item from the list then check the field value.
I would like to show how-to work with events under Applications and Services Logs using Powershell. For this, my examples use IIS Logging and tracing events. You can find out more in this article: http://blogs.iis.net/webtopics/archive/2010/03/19/iis-7-5-how-to-enable-iis-configuration-auditing.aspx
Sometimes I have to work with event logs under the Applications and Services Logs folder, which stores logfiles grouped by particular component of the system. By default it contains 4 categories with 4 logs: