SharePoint – Online access to a Windows Core IoT on RPI3

December 31, 2017

After converting my HW & SW Inventory Tool to SharePoint Online…

https://audministrator.wordpress.com/2013/05/14/sharepoint-computer-hw-sw-inventory/

I guessed why not try this against a Windows IoT on a Raspberry PI3 ?

And indeed it went as expected … so cool not Smile

image

Possibilities are unlimited … I can check to see if the RPI3 is still online (when the button lights up green) where ever I am

Next bonus effect is that I can do a reboot remotely.

Technology :

Technology used behind the scene is just SharePoint and Client Side – JavaScript.

Maybe I will share the scripts, but not for free… Winking smile

Happy New Year …

Advertisements

SharePoint – Online Content Editor CEWP Missing

December 22, 2017

When starting to work with SharePoint Online, first thing you notice is that the CEWP is missing out of the box Sad smile

But no stress, there are 2 ways of getting it back ….

Solution 1

Go to office365 admin –> SharePoint –> Setting –> Custom Script –> enable it

image

image

Be aware that this option will affect ALL site collection settings…which is not advisable in my opinion.

Solution 2

You can activate Publishing features for both Site Collection and Site level

  1. Site Settings > Site Collection Administration > Site Collection Features -> SharePoint Server Enterprise Site Collection features
  2. Site Settings > Site Actions -> Manage Site Features -> SharePoint Server Publishing

image

image

This option has only impact on the individual site collection, which is more advisable.

image

Enjoy !


Windows Server 2008 – Task Schedule Error 2147746323

December 18, 2017

When you schedule a Task you might run into the Error 2147746323.

The code appears after you schedule an Email Action

image

When you convert this error number to a HEX number it will disclose the root cause.

Use this PowerShell script to convert it to HEX

CLS

$Value = 2147746323

"0x"+ ('{0:x}' -f $Value)

It will look like this :

image

Meaning : The transport failed to connect to the Email server

So you need to investigate where it goes wrong in connecting to the server.

For more codes see here  :

https://msdn.microsoft.com/en-us/library/windows/desktop/aa383604(v=vs.85).aspx

Enjoy!


PowerShell – Crystal Reports COM Object

December 17, 2017

Recently I was going through my files and found (again) Smile the very nice Crystal Reports COM libraries

 

image

As you can see these are more then 15 years old !!

But still works like a charm … many years back I created an example in AutoIT using the CRViewer COM object.

image

Actually the Crystal Reports at that time came with some nice COM libraries, which are still my all time favourites.

And tons of functionality to automate your tasks…

image

It can access all kinds of Database formats using ODBC and native DB connections.

As you can see it also has a multitude of Export and printing abilities.

$Crystal_Report = 1
$Data_Interchange = 2
$Record_Style = 3
$CSV = 5
$Tab_Sep_Val = 6
$CharSepVal = 7
$Text = 8
$TabSepText = 9
$Paginated_Text = 10
$Lotus_23WKS = 11
$Lotus_123WK1 = 12
$Lotus_123WK3 = 13
$Word = 14
$Excel_5 = 21
$Excel_5_Tabular = 22
$ODBC = 23
$HTML32 = 24
$Explorer32 = 25
$Excel_7= 27
$Excel_7_Tabular = 28
$Excel_8 = 29
$Excel_8_Tabluar = 30
$PDF = 31
$HTML40 = 32
$Crystal_Report_7 = 33
$Report_Definition = 34
$RTF = 35
$XML = 36

 

PowerShell COM Backwards compatible ?

So the idea now is to see how PowerShell is able to handle these old COM libraries.

Here we go …  Smile

This script will read a Crystal Report 8.5 report using a MS SQL database data source.

Refreshes the data in the report, Exports it to Excel and next E-mails this to 1 or more recipients.

CLS

$Excel_7= 27

$ServerType = "p2lodbc.dll"
$ServerName = "ServerName"
$databaseName = "DatabaseName"
$user = "UserName"
$pswd = "Password"
 
$vFilenameReport = "C:\Deliveries per customer.rpt"
$vFilenameExport = "C:\Deliveries per customer.xls"

$oApp = New-Object -ComObject "CrystalRuntime.Application" # Com Object

# LogOnServer
    $oApp.LogOnServer($ServerType, $ServerName, $databaseName, $user, $pswd)

# Open Report
  $oRpt = $oApp.OpenReport($vFilenameReport, 0) # 0 / 1

# Report Options
  $oRpt.DiscardSavedData() # DiscardSavedData In Report to REFRESH
  $oRpt.EnableParameterPrompting = $False
  $oRpt.DisplayProgressDialog = $False
  $oRpt.MorePrintEngineErrorMessages = $False

# Export Options
Start-Sleep 2

  # $oRpt.ExportOptions.Reset | out-null
   $oRpt.ExportOptions.DestinationType = 1 # 1=>filesystem 
   $oRpt.ExportOptions.FormatType = $Excel_7  # 27=> Excel 7
   $oRpt.ExportOptions.DiskFileName = $vFilenameExport 

  # $oRpt.ExportOptions.ExcelExportAllPages = $True 
  # $oRpt.Export($True) # Export without prompting = False

   $oRpt.Export($False) # Export without prompting = False

# Send Email
 Send-MailMessage -to Your.Name@Company.com `
-from admin@Company.com `
-Subject "Monthly Email Service" `
-body "Hello !!! `nThis is your personal E-mail service.`nPlease find the updates enclosed.`nUntill next time. `nRegards," `
-Attachments $vFilenameExport `
-smtpserver YourEmailServer  

# Remove Attachment File
   Start-Sleep -s 2
   Remove-Item $vFilenameExport

 

If you schedule this script you have created your own reporting platform.

 

image

Keep in mind that you need to you the 32Bit PowerShell version

image

C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe

But it doesn’t spoil the fun Smile

And this proves PowerShell is 100% backwards COM compatible !!

 

Enjoy !


SharePoint – Difference between Item level Permission and Item level Security

December 1, 2017

Recently I discovered that in SharePoint there is a difference between Item Level Security and Item Level Permissions.

1. Item level Security

This is the one everyone knows…

You can set user security on each individual doc. in a library or a record in a list.


2. Item Level Permission

For Document libraries you can only modify this using PowerShell (or .NET)

In my opinion this has less performance impact than the Item level Security.

But of course it serves a different purpose too…

So depending on what you need I would definitely consider this option.

Here are the different options :

https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splist.writesecurity.aspx

SPList.WriteSecurity
•    1 = All users can modify all items.
•    2 = Users can modify only items that they create.
•    4 = Users cannot modify any list item.

https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splist.readsecurity.aspx

SPList.ReadSecurity
•    1 = All users have Read access to all items.
•    2 = Users have Read access only to items that they create.

Example :

CLS

if((Get-PSSnapin | Where {$_.Name -eq "Microsoft.SharePoint.PowerShell"}) -eq $null)
{
	Add-PSSnapin Microsoft.SharePoint.PowerShell;
}

$web = Get-SPWeb -Identity http://YourSP

$list = $web.Lists["Documents"]

"Read Security = " +  $list.ReadSecurity 
"Write Security = " + $list.WriteSecurity


For SharePoint lists you can just use the GUI :

image

Enjoy !